let say i has two object like picture A. And i need move the cube toward the capsule and it is require cube is parellel to the capsule. (like B) How to do it? i had success moved the cube to the capsule, but i can not figure out how to make the cube parallel with the capsule. thanks you in advise
on the cube use the next part of code: Code (csharp): transform.rotation = target.transform.rotation; target is the capsule.
this is not working on my case. Actually my object is quite more complicated(got parent and children), i am just use cube and capsule to represent my actual object. Hopefully i can get some idea on make two object parallel.
well if you havea a human model, parent it to another empty gameobject (if you have animations and such) and apply the same line of code on the empty gameobject, and on the model (which is parented to the empty gameobj) every other script you might need on it. so it will play animations and such, and the empty gameobject will rotate to be parallel to your target, and it will rotate your model as well.
I, and other people are probably confused by your example. Could you tell us the purpose of attaching multiple scripts to every portion of a model instead of iterating through the model and doing your solver there? If you have a human model, are you wanting a series of game objects that will mimic the animations of that human? What is the purpose? Is it to apply weapons, armor or other modifications to it?
well let me define "quite more complicated" with the picture above. Actually i use cube=hand capsule = "that thing" call jig I wish the right hand can move and parallel to the body of the jig. so i can grasp it and manipulate the jig.