01-05-2024, 04:39 PM
Update!
I reduced the complexity by calling actor.AddForce the negative force that I would add to character (trampoline force).
This iteration no need to query anything.
I reduced the complexity by calling actor.AddForce the negative force that I would add to character (trampoline force).
This iteration no need to query anything.
Code:
private void FixedUpdate()
{
if (bounceForce != default) {
actor.AddForce(bounceForce, ForceMode.Impulse);
if (_debug) Debug.Log($"{name} add {bounceForce.ColorMe(kColor.orange)} force to {actor.GetType().Name}!");
bounceForce = default;
}
}