- Edited
Hi guys,
I have some items in my project that the player should be able to carry around. He should also be able to drop or throw them. Very similar to the mechanics known from games like "Overcooked". So far I have solved this by making the items of type RidgedBody3D.
To carry the items around, I switch the Ridgedbody to "Freeze = true". That works quite well.
My problem now is that I have to do collision checks if, for example, you walk into a wall (StaticBody) with the item. This only triggers the events/signals OnBodyEntered if you set the values in the Item(RidgedBody3d) script as follows:
ContactMonitor = true;
MaxContactsReported = 100;
BodyEntered += OnBodyEntered;
BodyExited += OnBodyExited;
Freeze = true;
FreezeMode = RigidBody3D.FreezeModeEnum.Kinematic; // <--- Important
The events only trigger in FreezeMode Kinematic. And that's where the problem lies. This way, when you carry the item around and then let it go, energy is applied to the item and it flies around.
Is there a way to avoid this?
I also read somewhere that it's not good to move RidgedBody3D objects manually in Godot. Should I avoid this and only use StaticBodies? Even if I then can't use the physics engine for throwing, for example....
Please give me your opinion! :-)