Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | DarkShroom |
sorry if this is simple but “add_force” says “Nonexistent function”
all the tutorials and reference material shows a method for 2D not 3D?
how do i apply a force in 3d to a rigidbody node?
thanks
my final code solution (after being given the links) presented as i thought might be useful to give a concise answer
so i just one force on a unit, the most simple
var force_direction = Vector3(10,0,0) # null for no force
func _integrate_forces(state):
if force_direction:
state.add_force(force_direction,Vector3(0,0,0))
EDIT: i just realised my code is slightly wrong, as it adds force over and over, you just need to add it once
DarkShroom | 2018-11-10 19:07