Determining close distances with fast-moving actors

tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
edited May 2012 in Working with GS (Mac)
I have an actor ("ball") that moves past another actor ("bat") and I am trying to determine when the ball is within a certain distance of the bat. The problem I'm having is that if I increase the velocity to what I'd like it to be (e.g. 150), the ball seems to skip positions as it moves. So it isn't logging self.position.y as 400...399...398...etc., but rather 400...360...320...etc. Since I want to determine magnitude less than 5, I can't get it to work because the magnitude jumps from say 25 (through 0) to 15 on the other side of the bat.

All this is an attempt to avoid using collideable actors for various reasons (constraining attributes chiefly).

Is there another way I can more accurately measure the magnitude between the two actors?

Answers

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited May 2012
    I used 5 as an example. I actually have it set to 20, but at higher velocities (150+), it's not working.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Okay, I think I've figured it out. It still see log data that looks like skipping positions, but I managed to find a distance value and velocity that works. Thanks.
Sign In or Register to comment.