The online racing simulator
Which is best: direction or heading?
I am making something to alert officers when someone has gone the wrong way into the pits.

I can set a X/Y hitbox, and I want to make it so if they are facing a certain way within that hitbox, it alerts the officers that are currently on duty.

Which is the best variable to detect this, because, for me, they don't seem to be very reliable.

Atleast, thats what I've found anyway.

Can someone give me a suggestion on this please!
Well if you want to detect user who drive in reverse in the pitlane the only way is direction. If you want to detect people who are spinning you need heading. If you want to detect everything a mix of both would probably be the best ^^
thing is, the variables never seem to stay the same (like, within a close area).

ie, if direction is

2000

next time the SAME way, would be 4000 or something stupid.
Quote from Krammeh :thing is, the variables never seem to stay the same (like, within a close area).

That seems to happen only if the car is not moving. Once moving the direction stays solid and if you are not slipping it's the same as Heading for forward or -180 of Heading for reverse. So, just check speed. If it's zero, ignore direction.

The constant fluctuation of direction maybe a side-effect to Direction being defined as the direction of the car's motion and so it's not properly defined if there is no motion (or it's a bug)

So basically, look at speed and direction and you should be fine for detecting people driving the wrong way. Looking at the rate of change in heading might be useful to determine if someone is spinning.
Quote from sdether :That seems to happen only if the car is not moving. Once moving the direction stays solid and if you are not slipping it's the same as Heading for forward or -180 of Heading for reverse. So, just check speed. If it's zero, ignore direction.

The constant fluctuation of direction maybe a side-effect to Direction being defined as the direction of the car's motion and so it's not properly defined if there is no motion (or it's a bug)

So basically, look at speed and direction and you should be fine for detecting people driving the wrong way. Looking at the rate of change in heading might be useful to determine if someone is spinning.

the numbers are NOT staying the same. not at all. This is REALLY starting to annoy me now.
-
(MonkOnHotTinRoof) DELETED by MonkOnHotTinRoof
Quote from MonkOnHotTinRoof :I know that problem, that is why I recommend using heading, not directon.

thing is Monk, BOTH of them are going all over the damn place. Sigh.
Quote from Krammeh :thing is Monk, BOTH of them are going all over the damn place. Sigh.

Are you sure ? Direction yes, but heading stays still (well at least as long as you don't steer). Heading is what I use at traps and it works well (there were huge problems when I used direction).
Right, sorted that now!

Thanks for the help everybody .

Monk - we should exhange MSN Handles or something!

FGED GREDG RDFGDR GSFDG