I have been trying to implement a drift system to my game
- the friction changes to .1 and the car starts to drift however the frition doesnt return to the FRICTION2
I have been trying to implement a drift system to my game
I would need much more of your code to help more, but from this, I do see a little bit of an issue.
Here are some quick questions:
A) How are you detecting when the cart should start drifting?
B) How is the player controlling the car? Is the control all set in a local script?
C) Is the request to the server sending repeatedly (maybe because of the way you are detecting it) making the friction continue to set to Friction1
If you are controlling all of the other movement in a local script, I would recommend finding a way to implement drifting on the local script. While I don’t know how you are already doing it, I would recommend you use a Dot Product to detect drifting (if this is how your system should work).
A Dot Product would essentially enable you to compare how similar two vectors are, and if the car is moving in one direction and facing in a different enough direction, you could trigger the drift.
Otherwise, I don’t know how else to help right now, but more information or further questions would be great. Good luck.
Physical properties should be like this
PhysicalProperties.new(0.7, 0.5, 1, 0.3, 1)
The order is: Density, Elasticity, ElasticityWeight, Friction, FrictionWeight
A) Through a remote event
B) The controls are in a normal script
C) Its only changing it once not repeatedly
A) I still don’t understand what operation you’re using to detect when to start drifting.
B) How are the controls in a normal script if you’re using player keybinds? Can you clarify and explain a bit more?
C) I’m wondering if the issue is that it continues to send the remote event repeatedly, therefore making it unable to change back.
Please let me know if you need help.