Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Gibbler on April 28, 2012, 05:54:56 PM

Title: [SOLVED] Scrolling Textures with Playmaker
Post by: Gibbler on April 28, 2012, 05:54:56 PM
Hello all,

I am trying to make a slot machine, Im new to Playmaker and coding, was wondering if anyone could point me in the right direction, I have a model I made with 3 slots and 5 rows, I want it to be a video slot so no rotating wheels, I want the textures to scroll as if they were on a reel, any help or suggestions? thank you

Gib
Title: Re: Scrolling Textures with Playmaker
Post by: Alex Chouls on April 28, 2012, 06:14:57 PM
There's a Set Texture Offset action:
https://hutonggames.fogbugz.com/default.asp?W381

Check out PlaymakerSamples\TestLab\Material\MaterialEffects.

The FSM on "Click Me To Scroll Texture" shows how to use Set Texture Offset.
Title: Re: Scrolling Textures with Playmaker
Post by: Gibbler on April 28, 2012, 10:13:35 PM
Thank you!

well im on track, I have the one texture scrolling now on all 5 reels, :) thank you, thank you,, I do have one problem been trying to get it to add more textures, but I am running into the problem where it states "Named Texture" and the value is "_MainTex", I know this states to rotate the main texture, but is there a way to have several textures mapped to it? thanks again,, got me going! :)

~gib
Title: Re: Scrolling Textures with Playmaker
Post by: Gibbler on April 29, 2012, 02:00:37 PM
Ok been driving me crazy with this,, LoL about ready to give up, that works and all but there is no way to set up multiple textures? its nice to have the scrolling effect, but it only scrolls one texture, ack! what am I doing wrong?
Title: Re: Scrolling Textures with Playmaker
Post by: Alex Chouls on April 29, 2012, 02:19:20 PM
Not sure what you mean by one texture? Unity shaders use texture names like "_MainTex", "_BumpMap", "_Cube"... Is that what you're looking for?

http://answers.unity3d.com/questions/217703/what-are-all-the-texture-names-i-can-try.html
Title: Re: Scrolling Textures with Playmaker
Post by: Gibbler on April 29, 2012, 02:33:07 PM
thanks,

You see what I have is 11 textures that I am trying to scroll over one mesh, I have playmaker using the FSM with Float Intropolate, and then the set texture offeset next, pretty much built it from the example of "Scroll Texture offset" it only lets me define one texture to scroll, and I have been trying to get it to scroll 11 different textures, I am trying to create a video slot machine.
Title: Re: Scrolling Textures with Playmaker
Post by: Alex Chouls on April 30, 2012, 12:54:46 AM
I believe each of those texture will have its own material. Use the Material Index to target different materials on a mesh.
Title: Re: Scrolling Textures with Playmaker
Post by: Gibbler on April 30, 2012, 11:00:11 PM
Thank you for all your help,,,

I did some reading, and shouldve posted this above but didnt, I came to a road block on material index? do you have a link or know somehere I can search to read up on Material index's? thanks.
Title: Re: Scrolling Textures with Playmaker
Post by: Alex Chouls on May 01, 2012, 12:54:06 AM
The Mesh Renderer component in Unity has a list of Materials (see attached screenshot).

The Material Index in Playmaker actions lets you target a specific material in that list.
Title: Re: Scrolling Textures with Playmaker
Post by: Gibbler on May 01, 2012, 01:41:38 AM
IM feeling about stupid now! thank you!
Title: Re: Scrolling Textures with Playmaker
Post by: Alex Chouls on May 01, 2012, 01:49:34 AM
Unity definitely has a learning curve... Happy to help! :)
Title: Re: [SOLVED] Scrolling Textures with Playmaker
Post by: FractalCore on May 09, 2012, 02:11:33 AM
How expensive is this, Is it the same as doing it within a shader?
Title: Re: [SOLVED] Scrolling Textures with Playmaker
Post by: Alex Chouls on May 09, 2012, 10:33:37 AM
I don't know how Unity does this internally, but I can't imagine it would be a major factor in performance...

If you want to test the shader approach you can use Set Material Float:
https://hutonggames.fogbugz.com/default.asp?W406

Then you could stress test the 2 approaches...