Soares_D i create a player with CharacterBody and one box with RigidBody, i need when player push the box with a collision, but my player stay in collider with this box this is scene hierarchy node
DaveTheCoder Soares_D but my player stay in collider with this box After the collision, you want the player (CharacterBody3D) to stay attached to the box (RigidBody3D)? You could try this: In the player's _physics_process() method, copy the value of the box's linear_velocity property to the player's velocity property.
Soares_D DaveTheCoder I just need the player to push the box normally, like in version 3.X the player when walking and colliding with a rigidbody object he simply pushes
heavyrail func process_collisions(): for i in range(get_slide_collision_count()): var collision = get_slide_collision(i) for k in range(collision.get_collision_count()): var body = collision.get_collider(k) if not body is RigidBody3D: continue var point = collision.get_position(k) - body.global_transform.origin var force = 1 # put whatever force amount you want here body.apply_impulse(-collision.get_normal(k) * force, point)
Soares_D heavyrail I tested this code and it still didn't work I made recordings and also prints of the godots' screens in version 3.X and 4.X, I just need version 4 to work like in version 3 for the player to push objects, link: GD teste