playMaker

Author Topic: Create Multiple Joints on a single object [SOLVED]  (Read 5002 times)

Macol90

  • Playmaker Newbie
  • *
  • Posts: 15
Create Multiple Joints on a single object [SOLVED]
« on: July 15, 2016, 11:28:47 PM »
I posted a request in the Android forum for help on this but I'm still having trouble with it.

I'd like to be able to create several (fixed) Joints on an object.

Basically, if an object collides with another object they'll attach to one another. The trick is that I need them to both continue being dynamic and interact with other rigid bodies. That's why I can't parent them or create a new collider based on their boundaries.

Fixed Joint seem to be the only way to go,  but I'll need to attach multiple Joints.  The "Set Joint Connected Body" Action is almost there but it just places the new object in the first joint and creates a second joint with no "Connected Body"! 

This is getting frustrating because I know it's possible but every time I think I've found a solution something goes wrong!

Please help,
Mike
« Last Edit: July 16, 2016, 01:38:28 AM by Macol90 »

Macol90

  • Playmaker Newbie
  • *
  • Posts: 15
Re: Create Multiple Joints on a single object
« Reply #1 on: July 16, 2016, 12:53:45 AM »
I feel a bit stupid here...  I spent half the day banging my head for solutions, went to a birthday party for 4 hours, came back and wrote the above post, and suddenly the solution came to me!

Get Component: Collide Object (GameObject) then store RigidBody (Object)
Add Component: Use Owner, select FixedJoint as Component and store as Object
Set Property: Target FixedJoint (Object), set connectedBody as RigidBody (Object)

Rinse, Repeat!

Tested and works perfectly!  It's so simple and I wasted so much time!  Sigh...
Closes eyes and whispers: "Game development is fun. Game development is fun!" :)

jakeer

  • Playmaker Newbie
  • *
  • Posts: 1
Re: Create Multiple Joints on a single object [SOLVED]
« Reply #2 on: July 22, 2020, 05:28:04 PM »
Thank you ,super helpful.
For the other newbs,
Object variables need to be be created and defined in advance for this to work. In variables ,after making the object var, check the pop down menu under name, and set it up the "object type" in advance to for this to work.
« Last Edit: July 22, 2020, 05:30:00 PM by jakeer »