Change Velocity problem
Hi guys
I'm having problems with getting an actor to do what it's told lol
I have a missile spawn actor that spawns a 'Missile' actor at x-50 and y160 when the score reaches a certain score. This allows the missile to move onscreen which i use a 'Move To' attribute for (move to x=32 / y=160) so it scrolls and sits in the middle of the screen...that's easy
No I want it to start to rise up the edge of the screen (Constrained to x of 32) and when it hits y=300 go back down the screen and when it hits y=32 go back up - this should repeat until the missile is pressed and I use a 'Change Velocity' attribute and fire it right at a speed of 500.
All it does when it appears onscreen is stay at x=32 and y=160.
What am I doing wrong?
I have the change velocity on the x and y linked to Actor and I thought that might be the problem so have changed the x velocity and y velocity to Scene but that makes no difference.
Please help...thanks guys
I'm having problems with getting an actor to do what it's told lol
I have a missile spawn actor that spawns a 'Missile' actor at x-50 and y160 when the score reaches a certain score. This allows the missile to move onscreen which i use a 'Move To' attribute for (move to x=32 / y=160) so it scrolls and sits in the middle of the screen...that's easy
No I want it to start to rise up the edge of the screen (Constrained to x of 32) and when it hits y=300 go back down the screen and when it hits y=32 go back up - this should repeat until the missile is pressed and I use a 'Change Velocity' attribute and fire it right at a speed of 500.
All it does when it appears onscreen is stay at x=32 and y=160.
What am I doing wrong?
I have the change velocity on the x and y linked to Actor and I thought that might be the problem so have changed the x velocity and y velocity to Scene but that makes no difference.
Please help...thanks guys
Comments
Try interpolate instead of change velocity.
Rule:
When attribute self.position x = 50
When attribute self.position y = 160
Interpolate self.position y to 300.
Rule: When attribute self.position y = 300
timer, after 0.2 seconds, interpolate self.position y to 160
Rule: When attribute self,position y = 160
interpolate self.position y to 160
That should help.
Bray
Thanks a lot for that cool plan...will try that now and report back!
Thanks dude.
Just do this then:
Rule:
When attribute self.position x = 50
When attribute self.position y = 160
Interpolate self.position y to 300.
Rule: When attribute self.position y = 300
timer, after 0.2 seconds, interpolate self.position y to 50
Rule: When attribute self,position y = 50
interpolate self.position y to 300
All you have to do is change the y position.
Bray
I have sort of fixed it with spawning the missile at the top of the screen and move it to y=270 to goto 50. Then an attribute - if y=50 to go 270..that works fine and it now goes up and down the whole left edge of the screen.
Thanks for the insight into Interpolate. I only use that for changing alpha colour - e.g. to fade things in and out. I didn't know you could use it to move things too...
Thanks for all your help mate
Glad to help.