2D Toolkit Forum
2D Toolkit => Support => Topic started by: JakeTBear on January 23, 2014, 12:59:34 am
-
Hello,
I noticed something strange happening, my drawings were being clipped on the right side of my camera, I didnt know why this happened, so I checked their transforms and they were slightly rotated in the Y axis.
This is odd, it only happens when creating a prefab that contained a tk2dsprite in it, this is how I created them:
TargetObject = GameObject.Instantiate(PreFabClone, new Vector3(X, Y, Z), Quaternion.identity) as GameObject;
the PreFabClonewould be set in the editor, etc. the thing is if I manually set the rotation to 0, this fixes the problem but I dont understand why would it do that to begin with.
Any help would be appreciated! thank you.
-
tk2dSprite doesn't manipulate the position at all, so it couldn't be modifying that.
Try GameObject.Instantiate(...);
then set position
and set rotation to quaternion.identity after that
Sounds very much like unity screwing something up here.
-
I will do that, thanks! :)
if I happen to find out the reason this happens I will post it here.
-
Found the culprit, for some reason when instantiating any prefabs with playmaker and not specifying a rotation it will set them to 0.99 in the Y, nothing to do with 2Dtoolkit, thanks though!