bryann.and Posted May 17, 2020 Share Posted May 17, 2020 How can i attach two objects through a C# script? Lets say i want to attach and detach an object from the hand of a Character body, what approach should i use? While i'm at it, how can i make it follow the same movements as the hand? Can a simple Joint achieve this? I tried with a joint but i don't know how to move the joint to the hand of the character nor activate and deactivate the joint via code. This is probably a noob question but i just can't find it anywhere Link to comment
silent Posted May 18, 2020 Share Posted May 18, 2020 If your character is skinned you can use WorldTransformBone for that: https://developer.unigine.com/en/docs/2.11/objects/worlds/world_transforms/transform_bone/ 1 How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
bryann.and Posted May 18, 2020 Author Share Posted May 18, 2020 11 hours ago, silent said: If your character is skinned you can use WorldTransformBone for that: https://developer.unigine.com/en/docs/2.11/objects/worlds/world_transforms/transform_bone/ That worked, thanks! How can i proceed to activate or deactivate the link? Like, how can i remove or add the object via code to that WorldTransformBone that i created? Or change the mesh at least Link to comment
silent Posted May 19, 2020 Share Posted May 19, 2020 Since WorldTransformBone is inherited from Node you can use addChild to add objects to this node. You can check the UnigineScript sample (bone_00) in the Worlds section in SDK Browser for more information. 1 How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
Recommended Posts