Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

New answers tagged

0

There's a lot we can improve here: Don't use a force to jump. Forces are for a gradual push over time, like gravity or wind. A jump is a single sharp change in motion, so we should apply it with an impulse or velocity change. This ensures we won't have to go change our tuning numbers if we later change the project's fixed timestep, because the whole jump ...


0

First of do a raycast facing downwards from the player to check for ground, Using oncollision methods are a terrible idea. For example if you are jumping at a box in midair and then collide with said box the way you have it setup will tell your player that you are currently grounded.


1

By default, a RigidBody will not emit a signal when it collides with another RigidBody. This is usually a good thing, as RigidBodies may collide frequently, and could fire many signals that you don't care about, negatively impacting performance. If you do care about detecting RigidBody collisions, you should set RigidBody.contact_monitor to true and ...


1

You need to pass false for the infinite_inertia parameter of move_and_collide. From the docs: If infinite_inertia is true, body will be able to push RigidBody nodes, but it won’t also detect any collisions with them. If false, it will interact with RigidBody nodes like with StaticBody.


1

Directly manipulating the velocity of a RigidBody in _physics_process is not supported. From the docs: The body’s linear velocity. Can be used sporadically, but don’t set this every frame, because physics may run in another thread and runs at a different granularity. Use _integrate_forces as your process loop for precise control of the body state. You ...


Top 50 recent answers are included