playMaker

Author Topic: scrolling a conveyor belt[SOLVED]  (Read 5856 times)

santelia

  • Junior Playmaker
  • **
  • Posts: 78
scrolling a conveyor belt[SOLVED]
« on: June 07, 2012, 11:11:06 AM »
Hi,
I'm facing the problem of how to move a conveyor belt with a smooth and realistic movement. The conveyor belt, as in many situations, starts and ends under other objects, so there's room to manage what can happen at the end and what can happen at the beginning of it. One option is to build it by a number of tiles and move all the tiles at the same speed; then, as soon as any tile has gone out of sight, immediately move its position to the beginning, and make it start the path again. Another option could surely be to build the belt with a single mesh and to animate its texture, making the texture offset change accordingly to the desired speed. In such a case, could you suggest me how to manage such process through a playMaker action? I've taken a look at the Set Property action, but I haven't been able to find the right property to set.
« Last Edit: June 20, 2013, 01:28:40 AM by jeanfabre »

santelia

  • Junior Playmaker
  • **
  • Posts: 78
Re: scrolling a conveyor belt
« Reply #1 on: June 07, 2012, 01:26:57 PM »
Trying to do the conveyor belt texture movement by using a 3 states cycle and a float variable called texture_offset. The start state reset the variable to 0. The second state update the variable by adding 0.01, and the third state use action Set Texture Offset which sets the offset at that variable value. Of course with a close cycle between second and third states by using a FINISHED event on each one. Nothing happens. Both with every frame checked or unchecked. What am I doing wrong?

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: scrolling a conveyor belt
« Reply #2 on: June 07, 2012, 01:32:55 PM »
Have you checked out the PlaymakerSamples/TestLab/Material/MaterialEffects sample scene?

The Click Me To Scroll Texture object shows how to use Set Texture Offset to scroll a texture.

santelia

  • Junior Playmaker
  • **
  • Posts: 78
Re: scrolling a conveyor belt
« Reply #3 on: June 07, 2012, 03:39:45 PM »
Thank you Alex, where can I find that sample scene?

Ok, I've found the samples. A mine of gold  ;)
« Last Edit: June 08, 2012, 08:04:55 AM by santelia »

uberwolfe

  • Junior Playmaker
  • **
  • Posts: 59
Re: scrolling a conveyor belt
« Reply #4 on: June 11, 2012, 12:06:53 AM »
I am also looking for a solution to this. I checked the example and while I (think) I understand how the texture offset works I'm still not sure how to apply it to my needs.

I have a tank track texture that I need to animate obviously while the tank is moving.

The way I thought to do it just keep adding 0.5 to the offset amount, and then reset to zero when you stop.

The offset amount could get quite large as there is potentially alot of driving you will do with this tank without stopping... is there a limit to how much you can offset the texture?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: scrolling a conveyor belt
« Reply #5 on: June 11, 2012, 02:01:03 AM »
Hi,

 offset can grow to a very large number, it should not be a problem, it will loop internally. You however detect when the offset reach its "looping" point and switch it back to its starting value.

Also, for tank tracks anim, you will need to have some math to compute the actual travel of the track and deduce the offset required. Do you have that covered?

Bye,.


 Jean

uberwolfe

  • Junior Playmaker
  • **
  • Posts: 59
Re: scrolling a conveyor belt
« Reply #6 on: June 11, 2012, 02:27:02 AM »
Thanks as always Jean for your informative answer.

I think I should be right now, I'm going to play with the offset a bit and see how I go.
I will return to bug you all if it fails :D

Thanks again.

Flutlicht

  • Playmaker Newbie
  • *
  • Posts: 3
Re: scrolling a conveyor belt
« Reply #7 on: June 16, 2013, 09:58:28 PM »
Hi,

 offset can grow to a very large number, it should not be a problem, it will loop internally. You however detect when the offset reach its "looping" point and switch it back to its starting value.

Also, for tank tracks anim, you will need to have some math to compute the actual travel of the track and deduce the offset required. Do you have that covered?

Bye,.


 Jean

Hello, I have run into this issue too - I am not sure how to apply the math for the texture offset in Playmaker..?

Any help would be fantastic, thanks!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: scrolling a conveyor belt
« Reply #8 on: June 17, 2013, 06:30:31 AM »
Hi,

 you mean the math to adjust the texture offset compare to earth movement or simply how to offset the texture to being with?


bye,

 Jean

Flutlicht

  • Playmaker Newbie
  • *
  • Posts: 3
Re: scrolling a conveyor belt
« Reply #9 on: June 17, 2013, 07:14:24 PM »
Hi Jean

I am unsure how to loop the offset the texture like Uberwofle describes above.

Thanks

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: scrolling a conveyor belt
« Reply #10 on: June 19, 2013, 03:32:23 AM »
Hi,

you should use the modulo operation. it will loop automatically then.

http://hutonggames.com/playmakerforum/index.php?topic=4185.0

few examples can be found here:

http://answers.yahoo.com/question/index?qid=20080606152039AAygLIs


bye,

 Jean

Flutlicht

  • Playmaker Newbie
  • *
  • Posts: 3
Re: scrolling a conveyor belt
« Reply #11 on: June 19, 2013, 07:33:37 PM »
Hi,

you should use the modulo operation. it will loop automatically then.

http://hutonggames.com/playmakerforum/index.php?topic=4185.0

few examples can be found here:

http://answers.yahoo.com/question/index?qid=20080606152039AAygLIs


bye,

 Jean

Thanks Jean!!  :)