#Godot 4 : Pushable Crate / Box Using RigidBody2D

2 messages · Page 1 of 1 (latest)

rotund stirrup
#

Trying to create a pushable box that moves smoothly across a 2D Tilemap using Rigidbody2D (happy to use any other method).

For info:

Tilemap is 16px x 16px

Player is using default CharacterBody2D script.

RigidBody2D is 16x16 with rotation disabled.

CharacterBody2D has the addition of the script below :-

    for i in get_slide_collision_count():
        var collision = get_slide_collision(i)
        if collision.get_collider() is RigidBody2D:
            collision.get_collider().apply_central_impulse(-collision.get_normal() * 100)

However its very intermittent (it gets stuck on flat tile surface) and jittery in motion. Are there alternative methods to achieve this or ways to improve the above.

rotund stirrup
#

Okay I managed to use an alternative method that's a lot more stable.