Slastraf Posted August 30, 2018 Share Posted August 30, 2018 --Rotate local otherRot = self.otherEntity:GetRotation(true) local camRot = self.camera:GetRotation(true) if(otherRot ~= camRot) then self.otherEntity:AlignToVector(90, camRot.y, 0, 1) end I want to rotate an entity to match the camera's rotation on the y axis. However, when I use this exact script, it just sets a random rotation when I look more or less than 0 degrees on the y axis. How can it be fixed ? The Api reference to this has a broken script, it looks like this, btw : light->SetRotation(35,35,0);<br /> <br /> //Create a model<br /> Quote Link to comment Share on other sites More sharing options...
macklebee Posted August 30, 2018 Share Posted August 30, 2018 Without seeing this in action and the rest of your code, its hard to tell what exactly the issue could be. Why are you aligning the entity by 90 degrees in the X-axis as well? Seems like what you are trying to achieve based on your description could be solved just by setting the 'self.otherEntity' rotation by using SetRotation()? But again, just a guess since no example to test. 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...
Slastraf Posted August 31, 2018 Author Share Posted August 31, 2018 I solved it by using Math:Lerp earlier , and the +90 degrees are the offset from the imported model. 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.