I wondering why AddForce is not work when Z Rotation of rigedbody2D was freezed?
But if I not freeze Z rotation it will work properly.
Thanks!!!
I wondering why AddForce is not work when Z Rotation of rigedbody2D was freezed?
But if I not freeze Z rotation it will work properly.
Thanks!!!
Probably the 4th time I’ve mentioned this but it’s “Rigidbody2D”.
Using the rotation constraint on a Rigidbody2D will not stop linear forces being applied such as those you get when using AddForce.
You must be doing something else wrong.
Maybe show the script you’re using and more detail.
Thank you very much! Oh I was wrong again
Ok I just AddForce(power,ForceMode2D.Inpulse) to that rigidbody2D with Z rotation freezed, But it not push in properly way.
What does “not push in properly way” mean? Not move at all?
I don’t see why it wouldn’t move. I can only presume you’ve debugged what “power” is set to?
Maybe provide more detail here. Show the Rigidbody2D configuration, show the script etc.
Ok my rigidbody mass is about 5 and I use AddForce power 20 and ForceMode2D.Inpulse mode
I thought ForceMode2D.Inpulse this mode should don’t care about mass.
But in game the rigidbody2D after AddForce is stay not even move. (sometime not always)
I very wondering why it just move or not move sometime.
Unfortunately I cannot debug it for you based on little descriptions. There could be any number of things wrong here.
The rotation constraint does not affect adding forces as they are applied to the center-of-mass so only change the linear velocity.
Try changing the Rigidbody2D.velocity to see if it can move at all? Maybe you’ve got another script doing something? Try in an empty new project?