Can we get way to check number of joints a physics obj has?

0 favourites
  • 7 posts
From the Asset Store
Simple yet very life-like rag doll made with Physics!
  • If there was a way to check how many joints a physics object has currently, that would be great.

    At the moment, when you create a joint, it isn't instantly added, and you have to wait a bit before the physics gets updated. I think it's the same case when creating instances of physics objects.

  • Hi Prominent. Are the joints created dynamically in your game?

  • hundredfold, joints can only be made one way.

    There's no way of knowing if the joint has been made yet, though, which can give you in-adverse effects if you need to carry out an operation based on that information. It won't work if you just set a variable when you add the joint, because the joint won't be made exactly when the variable is set.

    physics updates every tick before the events are ran. Is this the case for joints (because it doesn't appear to be)? Do joints get created when a physics object is created, or do they get added after they get created, and if so, when?

  • I don't think there is any delay creating or joining a joint, at least, the way I did it for my Stickman game.

    For me it was like:

    On Enemy Created:

    Enemy.spawn Leg1

    Enemy.Create Revolute Joint at ImagePoint1 to Leg1

    Leg1.setAngle to 240 degrees

    Now, if my Leg1 had any delay in getting created or joined, then its SetAngle of 240 degrees command would automatically be skipped, but it didn't. Which means it used to create the joint instantly, then also goes and follows the next Action.

    You can easily have an "Add to" variable (of Joints), after the "Create revolute joint" and it will be executed accordingly.

  • Prominent Thanks, I think I need to play around with joints a little more to better understand them.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hasan999, the reason why the angle is set is because setAngle has no relation to physics- hence it doesn't need to wait for physics operations. What I'm asking about is related to the implementation of the physics and how the joints get updated.

  • Sorry to ressurect this topic.

    But is there a way I can do this?

    In my case i'm adding a joint to a circle on collision. And I need to keep track of how many objects are attached to the circle.

    The issue is, that i'm using on collision to create the revolute joint, but since the object keeps colliding, if I use add to to keep track it will add constantly.

    Thanks

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)