I want to make a car actor which can be controlled using W-A-S-D keys. let me explain the concept-
1. We use A and D to change the angle of the car actor, as well as it updates the animation of the car to face in the current angle.
2. W key makes the car actor move in the angle the car is facing. ( car actors directional velocity increases as the W key is held down and when the velocity reaches a certain amount, it cannot go further more. thus limiting cars speed )
3. S key is like brake for the car actor. when we press S key, the velocity of the car decreases and stops the car completely when reaches zero velocity.
4. collision. i want the car actor to stop completely ( zero velocity ) when it crashes ( collision at high velocity )on walls/objects etc.
Now the glitches,
1. the car will change it's angle even when not in motion ( at zero velocity ), and as the scripts, it will still update car actors animation when the A and D keys are pressed. and i don't want that to happen. i want the car actor to update the animation ONLY when it is in motion.
2.if the car crashes on the walls, as i mentioned above, i want it to stop completely. but, it should not happen when the car has low value velocity. ( no crash when the speed is low )
That's all! if anyone can explain me how to make this happen, please do!