#Add torque
1 messages · Page 1 of 1 (latest)
You can use a "list (collider)" variable, manually add these 4 colliders in the list and then use "for each" node.
Connect this variable in this node in the 3 white dashes, and then connect body output to addForce.
And connect output item to "this" addForce node.
Just be aware what kind of mechanics you want
Because in real life, most cars have torque in these options:
- wheels in front, front drive
- wheels in the back, rear drive
- 4x4 wheels
And then you could go special with AWD - stopping torque in each wheel individually in certain conditions
In that case, you could add torque using a IF before and use a proper bool.
For example, using physic query "rayCast" down (0, -1, 0) and detect Water instead of Ground layer then stop adding torque. Just as an example. Because you could make certain surfaces activate "slip" effect to the wheels
Thanks, all makes sence now! I will try it?!
You could also use a "sequence" node. And put 2 or 4 in there.
And independently add IF before addTorque to each wheel if needed.
Sequence node runs 1, before 2. So when output 1 is completed it runs output 2 and so on.
Very useful in certain scenarios
Sure ✌️
I get this error message when i try to connect all wheel colliders with torque
You might have the wrong list type here
maybe i have to get list items before i use?
Just use one of these which ever you prefer
Exactly.
For each is the cleanest imo. Sequence makes it easy to add conditions if its needed though.
Just make sure to use the right list type.
You could use "list colliders" and thats it. Instead of wherl collider and test if it works
Great , i already tried this but i always get last item of list.
Connect the body output
The exit triggers when the loop is done, body triggers for every item in the list
you are a savior 😄
"and then connect body output to addForce"