Problem with RigidBody3D

Godot Version

4.6.1

Question

I have a problem with object collisions, when an object touches an object just a little bit or something else, it starts either passing through it or being in a different position. If this is not a bug, then how can I fix it?

Script:

extends RigidBody3D

@export var positions: Array[Node3D]
@onready var rng = RandomNumberGenerator.new()

var pickuped: bool = false
@onready var dropObject = get_tree().current_scene.get_node("Player/Camera3D/DropObject")

var pos_item
var pos_obj
@export var original_name: String = ""
var item_name: String

func hit_obj(body):
	pos_item = body
	freeze = true

func _ready() -> void:
	var chance = rng.randi_range(0, positions.size() - 1)
	if positions:
		global_transform.origin = positions[chance].global_transform.origin
		global_rotation = positions[chance].global_rotation
		print(chance)
	item_name = ""

func pickup(object):
	pos_item = null
	pos_obj = object
	pickuped = true

func _physics_process(_delta: float) -> void:
	if pos_item != null:
		global_transform.origin = pos_item.global_transform.origin
		
	if pos_obj != null and pos_item == null:
		if pickuped:
			contact_monitor = false
			freeze = true
			global_transform.origin = pos_obj.global_transform.origin
			global_rotation = pos_obj.global_rotation
			item_name = original_name
			if Input.is_action_just_pressed("Drop"):
				global_position = dropObject.global_position
				pickuped = false
		if !pickuped:
			freeze = false
			item_name = ""

func _on_area_3d_body_entered(body: Node3D) -> void:
	if !pickuped:
		if body.is_in_group("Floor"):
			$DropSound.play()

I’m trying to understand so I will ask you why a RigidBody? Do you need your hammer interact using physics with the environment? Becousa if that is what you want looks like is what you describe as actual behavior. If not, if you need just leavi it there to be picked, the Area or an StaticBody should be enough.

I want to create a game based on the Granny mobile game in which you can pick up and throw objects. What other details can I tell you?

Ok, so If you will throw the item it’s Ok to use a RigidBody. What I will recommend you is to have an Area bigger so will be interacted to be able to pick it before any RigidBody interaction like your player pushing it. Of course, if you drop it, any other RB will physically interact with it.

Forgive me if you don’t understand what I mean.
I’ll tell you in more detail now. In the image where I show the hammer setting, you might have noticed the value of Max Contacts Reported, it is set to 3. The problem is that when it is set to 0, it is in the position where it should be, and when it is greater than 0, it either gets stuck or it does not exist at all. I set the value so that the object moves when you open the drawer, but as you can see, the hammer is not in the drawer, but in the shelf, and you can see that the hammer itself is stuck in the texture. I hope that I explained the situation in more detail, if not, then I’m sorry, I’m just explaining poorly.
And to make it even clearer, I’m throwing an image where the hammer should be located.

Ok, from the images and your explanation, are you sure is stuck on a texture or maybe there are no collider there? It is possible the drawer colliders do not include that part and is just lying there because fell and is just there over a collider?

No, it has a collider. And there are no problems with the drawer. Just like I said, this problem only occurs on the shelf.