Dunno if anyone else had this but when I parent a object on a humanoid animated character, the "transform.position" returns the wrong position ( tested in 5.1.3 ). If I pause the editor, unparent and redebug it says the right position but as long as it's parented it wont, any ideas?
I want to instantiate a bullet at the tip of a gun and when that gun is parented to the hand of the character the world position is wrong and the bullet gets instantiated at the center of his body instead. If I unparent it then the world position works fine
I fixed it with a hack by adding a monobehaviour on the tip and stored the position in a variable, that way it provides the correct position information, someone has to look into this one...
@Suddoha how do you create the weapon in the hand? If you have done this with a monobehaviour then it'll have the correct result as my solution which aren't an answer as to why transform.position doesn't work at all times @BoredMormon I have the object and I do .transform.position, I don't see how this can be wrong, also when I'm unparenting on the same second without changing any code the result is correct.
I simply created 2 objects, one being the child of the other. I placed them manually. The only thing i've done with scripts is a Debug.Log() and it always prints the position to the console that i expect. Sorry if i misunderstood something. Maybe you could add some pictures/screenshots and your script?