Im Trying To Make A 2D Top Down Fighter Game And I Was Looking For An Object That Could Stop CharacterBody2ds That I Was Gonna Use For Obstcales And Decided To Use RigidBody2ds But Even Do Gravity is set to 0 It Still Moves When Comes In Contact With a CharacterBody2d. how can i prevent this?
It depends on whether you want your obstacle to be moving.
If you want your obstacle to stay still (i.e. be static), you should use a StaticBody2D instead of a Rigidbody2D.
If you want your obstacle to move while still blocking the player, you should use a RigidBody2D node with its freeze-setting set to true and its freeze_mode-setting set to FREEZE_MODE_KINEMATIC.
You can read more about the two node types in Godot Docs:
Altering the position directly will not interact with physics. I recommend your player be a CharacterBody2D and other stopping-objects be A StaticBody for walls and RigidBody for anything the player could push.
Check out the template for CharacterBody2D’s movement, the key is it sets velocity then uses move_and_slide() all inside _physics_process(delta: float):
Do you mind expanding on what fixed it? Honestly the change to velocity should’ve been the first step to a proper solution, I did not understand the original post all that well