playMaker

Author Topic: [SOLVED] Scrolling Textures with Playmaker  (Read 9216 times)

Gibbler

  • Playmaker Newbie
  • *
  • Posts: 6
[SOLVED] Scrolling Textures with Playmaker
« 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
« Last Edit: May 01, 2012, 01:49:52 AM by Alex Chouls »

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: Scrolling Textures with Playmaker
« Reply #1 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.

Gibbler

  • Playmaker Newbie
  • *
  • Posts: 6
Re: Scrolling Textures with Playmaker
« Reply #2 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

Gibbler

  • Playmaker Newbie
  • *
  • Posts: 6
Re: Scrolling Textures with Playmaker
« Reply #3 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?

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: Scrolling Textures with Playmaker
« Reply #4 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

Gibbler

  • Playmaker Newbie
  • *
  • Posts: 6
Re: Scrolling Textures with Playmaker
« Reply #5 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.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: Scrolling Textures with Playmaker
« Reply #6 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.

Gibbler

  • Playmaker Newbie
  • *
  • Posts: 6
Re: Scrolling Textures with Playmaker
« Reply #7 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.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: Scrolling Textures with Playmaker
« Reply #8 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.

Gibbler

  • Playmaker Newbie
  • *
  • Posts: 6
Re: Scrolling Textures with Playmaker
« Reply #9 on: May 01, 2012, 01:41:38 AM »
IM feeling about stupid now! thank you!

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: Scrolling Textures with Playmaker
« Reply #10 on: May 01, 2012, 01:49:34 AM »
Unity definitely has a learning curve... Happy to help! :)

FractalCore

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 100
Re: [SOLVED] Scrolling Textures with Playmaker
« Reply #11 on: May 09, 2012, 02:11:33 AM »
How expensive is this, Is it the same as doing it within a shader?

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: [SOLVED] Scrolling Textures with Playmaker
« Reply #12 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...