can we apply a force in the direction of the hit ? if yes whats the fuction for that and where to place it ? After Starting the skeleton physical simulation?
I should have included this in the video For knockback, create this function in the hitbox code: func apply_knockback(): var knockback_direction = parent.transform.basis.z parent.velocity = knockback_direction * knockback_strength and call this function in the take_damage() function If you mean applying force to the ragdoll simulation, you can put something like this in your projectile or gun code: if collider is PhysicalBone3D: var knockback_direction = -transform.basis.z collider.linear_velocity = knockback_direction * knockback_strength
can we apply a force in the direction of the hit ? if yes whats the fuction for that and where to place it ? After Starting the skeleton physical simulation?
I should have included this in the video
For knockback, create this function in the hitbox code:
func apply_knockback():
var knockback_direction = parent.transform.basis.z
parent.velocity = knockback_direction * knockback_strength
and call this function in the take_damage() function
If you mean applying force to the ragdoll simulation, you can put something like this in your projectile or gun code:
if collider is PhysicalBone3D:
var knockback_direction = -transform.basis.z
collider.linear_velocity = knockback_direction * knockback_strength
@@yeonjum that was simple ! Thanks man.
keep progressing i have suscribed.
look forward to see your future developments with godot.
this is something I have always wanted to know how to do since solders of fortune double helix so thank you
do you have the project on github? :)
i don't, sorry. could you tell me what you need help with?