Coder Social home page Coder Social logo

Comments (3)

Ughuuu avatar Ughuuu commented on June 11, 2024 1

Ok, while true it doesn't work, I would be careful anyway using this way. Rigidbodies should be separate. If you group them as you do, eg RigidbodyA parent and RigidbodyB child,
RigidbodyB will have its set_transform method called every frame. While it might be performance intensive, that's not that important really as it is that it's setting its transform instead of using the velocity. So the physics simulation quality will suffer also, resulting in a lot of jitter.

If you want to group Rigidbodies, I suggest having a parent Node2D for both Rigidbodies and create a scene with those, but dont have child Rigidbodies.

As for this bug, it seems that every time the body position is changed, the reference angle should be updated somehow too I guess, will have to look into it more. But since it's anyway not a use case that should be done, since as I said it's bad for performance and physical stability, not sure if it's worth investing time into fixing this one.

Later Edit:

To explain more on this, it's as if you are teleporting the second rigidbody every frame instead of letting the physics server update it. Which is not necessarily bad, for if you want to teleport the body every frame, either use kinematic body for that or static body. If you don't, then use rigidbody with impulse.

from godot-box2d.

Ughuuu avatar Ughuuu commented on June 11, 2024

Uh, this seems like a very tricky case. Am wondering what Godot does in this case for rigidbodies parented.
Anyway, I don't see a good use case for it anyway, I think you just shouldn't parent a rigidbody to another. Will ask around on the Godot Chat to see what happens in Godot when you do this(parent rigidbody with child rigidbody)

from godot-box2d.

tomsep avatar tomsep commented on June 11, 2024

While this can be mostly avoided by not parenting NodeB to NodeA it might cause headache when trying to structure your scene. For example, when you want to combine multiple RigidBody2D based scenes to create a new scene.

When using Godot default physics the joint limits seem to always be relative to global origin. So, regardless of the "Cube"s orientation the "Antenna" will always point world up as the joint limits are set to [-10, 10]. I don't think that is good behavior but not sure if it is a bug or not.

from godot-box2d.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.