Closed Occult-Dev closed 7 years ago
Hey so, I just checked out the CraftStudio glossary and noticed that it said under Transform:GetPosition, Transform:GetLocalPosition:
If your game object is at the root of the scene then
GetLocalPosition
is equivalent toGetPosition
.
Is this what's happening here? My Camera is in the root of the scene.
Well, if my comment above is what's happening, then hopefully the latest PR I made to the docs help clear it up for future readers. Let me know if I got something wrong! :) https://github.com/superpowers/docs.superpowers-html5.com/pull/15
When using the methods:
this.actor.rotateEulerX()
&this.actor.rotateLocalEulerX()
, they both seem to do the same thing.My setup [ I've set the y-axis to be my up / down axis ]: I have a behavior attached to a Camera, and when I hit the 'left' and 'right' arrow keys, the Camera rotates along the y-axis. This works fine. However, when I hit the 'up' and 'down' arrow keys, the Camera should rotate along the x-axis. This doesn't work.
Only if my Camera's y-axis is set at
0
will the Camera rotate along the x-axis correctly. But when I turn the Camera left or right [ by rotating along the y-axis ], the Camera no longer rotates around the x-axis correctly. It begins to turn and rotate in a very odd manner [ looking to the right / left makes the Camera rotate along the global-x-axis when rotating using the x-axis in code, regardless of whether or not I use rotate or rotateLocal ].Sorry if this doesn't make sense, it's very late and my brain is fried dealing with 3D math haha. Basically, the issue is the rotation methods provided by Superpowers don't appear to work the same in code as they do in the scene editor.