Rotation, angle on actor

skottskott Member Posts: 172
edited November -1 in Working with GS (Mac)
I'm making a car drift game and would like a score to count up every time my car is like +/-10 degrees from it's current angle. I got the car movement and score setup, but how to determine the angle problem?

I'm also thinking that the car must have a certain speed before the score counts up - So that it's angle and speed that sets the score...

Comments

  • rebumprebump Member Posts: 1,058
    Well, you know the speed of the car, that part is easy. You know the rotation of the car too but you need to relate that to where it is on the track, so maybe define your track and then have zones on the track that you use to determine where the car's rotation needs to be to be considered drifting.

    Actually, instead of using X/Y position zones of the track, maybe add some large, invisible actors at the drift regions that when overlapping/colliding with the car, they set game level attribute(s) with the desired drift value(s)/range(s). Then the car can (also upon overlap/collide with those invisible actors) wait a fraction of a second and then read those game level attribute(s). Using those values and the car's speed, calculate if scoring should occur.

    Each area may need multiple invisible actors to define the curve.

    Also, you may want to place a debug "Display Text" of the car's angular velocity while sliding around corners to see if there is any value there that you can use.
Sign In or Register to comment.