playMaker

Author Topic: Set Texture Offset [SOLVED]  (Read 8559 times)

shsha

  • Playmaker Newbie
  • *
  • Posts: 8
Set Texture Offset [SOLVED]
« on: June 06, 2011, 10:17:24 AM »
hello

i`m trying to make a simple game useing PlayMaker

so .. how to make texture offset

i`m useing two actions ,  set texture offset & per secound with the state but it`s not working
i`m trying to use the same concept of java script........... like this


 var speed : float;
function Update () {
renderer.matrial.SetTextureOffset("_MainTex" , vector2(0,Time.time * speed ));
}


thanx
« Last Edit: November 05, 2011, 02:55:24 PM by alexchouls »

LordShaggy

  • 1.2 Beta
  • Junior Playmaker
  • *
  • Posts: 50
Re: Set Texture Offset
« Reply #1 on: June 06, 2011, 06:12:19 PM »
Could you make an FSM template of what your doing and post it to DL so I can look it over?

It sounds to me like your gonna to need an FSM that it's only job is to every frame do your texture offset thing.  Which it will grab the speed variable from another FSM.

But without looking at your set up and a better understanding of what your trying to do I can only theory craft.


Some things to check:

-Make sure that the number is actually changing per a second.   IF i9t is not, then you are not updating and pointing the the right stuff.   

The texture Offset action does not just by itself offset the texture, it just allows it to be offset, so you have to change the variables it is Dependant on in real time.

I would suggest doing a dual FSM set up.  Have 1 FSM with 1 state that all it does is do texture offset based on time and have it pulling info from another FSM that is changing speed.  That way you can have your input and your update happening at the same time.

For an experiment do as follows, to make sure everything is working correct and your not experiencing a bug.



------------------------
Put FSM on textured Object.
-Add Animate Float action
-Create variable test (make it a float)
-Drag your animate float set up so it's like 10,10 or something really Far right and up.
-Have it be manipulating test.
-Add offsetTexture action.
-Keep it all default, but change the X value to represent Test
-Now hit play and watch the FSM.  you should see the value changing over time as it is being animated, and if you put it on the object right.  You should see it's texture going buck wild. (This will confirm your at least using it right)


Then try to do what I said earlier. Confirm you are using the actions right first. =D


LordShaggy

  • 1.2 Beta
  • Junior Playmaker
  • *
  • Posts: 50
Re: Set Texture Offset
« Reply #2 on: June 09, 2011, 12:02:14 AM »
Did this solve the issue ?

shsha

  • Playmaker Newbie
  • *
  • Posts: 8
Re: Set Texture Offset
« Reply #3 on: June 09, 2011, 07:55:43 AM »
hello

it`s working well ..... ;D


thanx alot it`s so nice of u ....

LordShaggy

  • 1.2 Beta
  • Junior Playmaker
  • *
  • Posts: 50
Re: Set Texture Offset
« Reply #4 on: June 09, 2011, 11:01:52 AM »
Thanks for letting me know =D.  I am glad it helped solve the issue.

meaphly

  • Playmaker Newbie
  • *
  • Posts: 26
Re: Set Texture Offset
« Reply #5 on: October 29, 2011, 03:58:41 PM »
I cannot succeed making a scrolling texture it seems unnatural.
Could you please post a JPEG image of the FSMs?

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: Set Texture Offset
« Reply #6 on: October 29, 2011, 07:36:40 PM »
Playmaker ships with a sample scene called MaterialEffects that shows how to scroll textures and other effects.

Gua

  • Beta Group
  • Sr. Member
  • *
  • Posts: 309
    • Andrii Vintsevych
Re: Set Texture Offset
« Reply #7 on: March 19, 2014, 03:18:35 AM »
Playmaker ships with a sample scene called MaterialEffects that shows how to scroll textures and other effects.
Can't find it in the latest version of Playmaker :(

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Set Texture Offset [SOLVED]
« Reply #8 on: March 19, 2014, 05:00:08 AM »
Hi,

 it's in the samples, it's a separate download:

http://www.hutonggames.com/samples.php

bye,

 Jean