moving platform disappearing off screen sometimes
matthowarth
Member Posts: 76
hi all,
I have a moving platform in our game. I have moved it back and forth on a cycle that will go on forever. To achieve this I :
added a "change velocity" behaviour - direction 180, speed 125 relative to actor
and
a timer which every 2.8 seconds has a "change attributes" behaviour to change self.motion.linear.X to
-self.motion.linear.X
The problem is that the platform sometimes (and that's the weird thing) wanders off screen and then back again.
Is there a random factor in there that I'm unaware of?
Any thoughts how I can solve it?
Just a quick compliment to the team at GS, this is great software and we are having a massive amount of fun using it. Now, if we could make some money with it too.......
cheers
Matt
I have a moving platform in our game. I have moved it back and forth on a cycle that will go on forever. To achieve this I :
added a "change velocity" behaviour - direction 180, speed 125 relative to actor
and
a timer which every 2.8 seconds has a "change attributes" behaviour to change self.motion.linear.X to
-self.motion.linear.X
The problem is that the platform sometimes (and that's the weird thing) wanders off screen and then back again.
Is there a random factor in there that I'm unaware of?
Any thoughts how I can solve it?
Just a quick compliment to the team at GS, this is great software and we are having a massive amount of fun using it. Now, if we could make some money with it too.......
cheers
Matt
Comments
and an Every type Timer ... consumes resources...
you could use walls.. placed outside of black screenSize area and Rule when platform collides with wall change direction...instead of Timer
or you could use the platform's... self.Position.X > game.Display Size.Width - self.Size.Width
or self.Position.X < game.Display Size.Width +self.Size.Width... to change linear velocity direction(+ or -)...instead of a Timer.
MH
this is giving me a bit of trouble.
I have an actor on the platform which I now have bouncing between two walls. I've included a "constrain attributes" on the platform to control a real attribute called "plaformX". My actor on the platform has a "constrain attributes" constraining his x position to "platformX", but he just stays where he is and doesn't move. I've tried moving the "constrain attributes" on the platform above and below the movement rules. I've also tried moving the platform and the actor on it, up and down the scene stack, but to no avail.
any thoughts?
cheers
Matt
I haven't used interpolate, I'll go have a play.
thanks
Matt
Say the platforms x is at 100 and you want to move back and forth between 100 and 200
Have a rule when attribute self position x =100, interpolate self position x to 200
then have another rule when self position x =200, interpolate self position x to 100
cheers
Onto the next bit! : )