thehankinator Posted July 18, 2018 Share Posted July 18, 2018 Calling GetAngle() on a sprite set to Billboard mode is always returning 0. Here is how I set it up: 1) Create a sprite 2) Set it to Billboard mode 3) Assign a material 4) Put this script on it function Script:UpdateWorld() System:Print(self.entity:GetAngle()) end The billboard appears to be working (always facing the camera) but the script always prints 0. I tried casting it to a sprite ( tolua.cast(self.entity,"Sprite") ) and calling GetAngle on that but no change. Any idea what I am doing wrong? Quote Link to comment Share on other sites More sharing options...
macklebee Posted July 19, 2018 Share Posted July 19, 2018 The GetAngle() returns the rotation of the 2D plane set from SetAngle() apparently. If you rotate your sprite with SetAngle(), it doesn't change the angle of a sprite in billboard mode in reference to the camera - it changes the rotation of the 2D plane around its center. And it appears that the sprites' rotation in relation to the camera does not have anything to do with the sprite's 3D rotation - I assume since its probably a shader controlling the rotation? Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
thehankinator Posted July 19, 2018 Author Share Posted July 19, 2018 That makes sense, Thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.