Playmaker Forum
PlayMaker Updates & Downloads => Official Action Updates => Topic started by: Alex Chouls on March 16, 2012, 06:36:31 PM
-
New action to connect a joint to a game object.
EDIT: Changed action to work on any Joint type, not just hinge joints.
-
Thank you very much. What I'm working on at the moment was relying on this, so I'll let you know if anything goes awry shortly.
EDIT: Works perfectly! :)
-
How difficult would it be to make this universally applicable to all joint types? I failed at making a version of the action for use with Spring Joints.
-
To be honest I haven't used Unity joints much yet. Hinge joints seem to have special status as a GameObject property, so I started with that...
There are a few different ways I can see to extend this:
1. Instead of using the hingeJoint property, use GetComponent<Joint>() to get the first joint of any type on the object.
2. Or use a popup to select the type of joint to find and connect.
3. Or instead of a GameObject variable type, take an Object variable of type UnityEngine.Joint. You would then need a Get Component action to get the joint you want to connect. IOW, 2 actions instead of one.
1 seems like a good solution if the typical use case is to have a single joint on a GameObject.
2 allows you to have multiple joint types on a GameObject. Is this a common use case?
3 is the most flexible, but requires the most work from the user.
Like I said, I haven't used joints a lot, so I'm not sure which solution is best.
Any thoughts?
-
Okay, I went with option 1 since it's the way the action probably should have worked in the first place!
Also you can use Set Property for option 3.
I edited the download at the top of the thread.
-
Alex,
Thank you for this, and sorry I wasn't able to get it working myself when I tried. I appreciate your effort very much.
I will let you know if I run into any issues with it.