Magnitude, Rotate To, Move To, or other
mhedges
Raised on VCSMember Posts: 634
Hello,
I have two actors, one stationary (A), the other one (B) in constant random movement. When B's magnitude (closeness to A) is under a set value, say, 200, then B should go collide with A.
The problems lies on the fact that B should act as if on wheels, thus should rotate while moving forward to intercept A, not just halt and go to A regardless of direction. I did a Rotate To (A's direction), but it both rotates to and moves to A. Any clues as to what I did wrong?
Thanks, regards.
Comments
I presume this is a top down game ?
I would do it like this . . . (file attached)
@Socks, thanks for your reply. Yes, it's a top down game. You're too kind with the zip file; i'll post results when I test it at home.
My Blog / App Store / Google Play
@Socks,
I looked at your approach. It's odd, as you used a plain old actor as a detector instead of magnitude! I would've never thought of that.
Something else got me, and pardon my ignorance, but where is the code in which the car is told to move randomly? I didn't see it in wither the prototypes or the "onscreen actors".
Edit - Of course, it's in the "otherwise" section...
My Blog / App Store / Google Play
To be honest I was just being lazy, it was a quick and easy way of achieving the same result.
Yep ! GameSalad really needs some little indicator to alert the user to the fact that are rules in the otherwise section, it's so easy to miss them.
BTW, to answer my own question in case anyone has a similar problem in the future, the solution is to just use "Rotate To" and x,y are Actor A's x,y (constrained elsewhere), and eliminate the "Move To" behaviour.
My Blog / App Store / Google Play