Magnitude, Rotate To, Move To, or other

mhedgesmhedges 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

  • SocksSocks London, UK.Member Posts: 12,822

    I presume this is a top down game ?

  • SocksSocks London, UK.Member Posts: 12,822
    edited February 2015

    I would do it like this . . . (file attached)

  • mhedgesmhedges Raised on VCS Member Posts: 634

    @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.

  • mhedgesmhedges Raised on VCS Member Posts: 634
    edited February 2015

    @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...

  • SocksSocks London, UK.Member Posts: 12,822
    edited February 2015

    @mhedges said:
    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.

    To be honest I was just being lazy, it was a quick and easy way of achieving the same result.

    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 either the prototypes or the "onscreen actors".


    Edit - Of course, it's in the "otherwise" section...

    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.

  • mhedgesmhedges Raised on VCS Member Posts: 634
    edited February 2015

    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.

Sign In or Register to comment.