How do I pin something using the Physics behaviour!?

  • Hi all,

    I know about the revolution and distance joints, but I want to bolt two objects together while only allowing limited rotation.

    The objective is to make a physics-enabled 2d space craft game where you have to build a ship out of components. Some components are fixed totally rigidly (e.g. different parts of the main chassis and armour), whereas others (such as directional engines, thrusters and blasters) can be rotated in a controlled way from a pinned location on the vehicle.

    Where do I begin?

    So far, the closest I've got is using two distance joints at the corners of an object to try and hold it in place, but the distance joints are like rubber bands. I'd rather they were more rigid.

    Help?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I dont think pins work on physics objects.

    Make your own pin by:

    Every tick ---- Set position----you physics object X and Y. (or the image point you want to glue it too.)

  • Problem is both objects are physics objects, so I don't think a simple Set Position will blend them the way it should, because the physics engine won't know they're connected.

    I've managed an alternative using two Revolute Joints which keep the pinned object in a fixed orientation relative to the parent object.

  • You can disable physics on one of them, then the pin might work.

  • It won't. You can't mix Pin & Physics.

  • blackhornet is quite right one cannot mix Pin & Physics. In Physic you could use limited revolute joint, create revolute joint or create distance joint

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