Actor wont recycle to random point
I know how to send an actor to a random point when it does off screen as I have done it on windows GS. But now I am trying to do it on MAC GS and when I set my actor to a random point it just disappears and I don't know why.
I even tried this rule.. when self.position.y < 0 change attribute self.positon.y to random(0,480)
Doing this should make is appear on my screen again but after it hits point 0 it disappears.
Someone please help
I even tried this rule.. when self.position.y < 0 change attribute self.positon.y to random(0,480)
Doing this should make is appear on my screen again but after it hits point 0 it disappears.
Someone please help
Best Answer
-
MobileRocketGames Posts: 128
I would have to assume its simple human error.
We all overlook things sometimes. No big deal.
So it looks like your screen is in portrait mode (320x480 as opposed to 480x320). Is this correct?
Try this:
Delete your change attribute behavior and create a new one.
Set it change the self.position.Y to 240.
Now set the X/Y attributes to 160/-20.
The actor is now in the center X-wise and -20 under the screen Y-wise.
As soon as you press Preview the actor should appear in the very center of the screen.
If it doesn't then you're going to need to take a screenshot of the behaviors affecting the actor and post them.
Edit: After reading your post again it seems there are factors you neglected to mention:...but after it hits point 0 it disappears.
Why is this actor moving? Are you moving it? How? It should be painfully obvious that we could throw answers at you all day without success until you explain your problem. Is there something affecting this actor, such as a constrain to touch, gravity, interpolation, etc?
Just as a stab in the dark, if you are interpolating this actor downwards; Interpolation cannot be interrupted by a change attribute behavior.
Answers
In the expression editor i was typing out random(number1,number2)
Turns out I had to click the word 'random' from the dropdown list then type in my numbers.