Andy Gilbert Posted September 25, 2013 Share Posted September 25, 2013 Just wondering how i can turn objects towards other ones. I know there is "point" I want be able to do this just on the Y axis, not all the others. Thanks Andy Quote The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do. Leadwerks Game-Ready 3D Models:https://sellfy.com/gib3d Link to comment Share on other sites More sharing options...
shadmar Posted September 25, 2013 Share Posted September 25, 2013 Second argument in Point specifies the axis Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
Andy Gilbert Posted September 25, 2013 Author Share Posted September 25, 2013 Yea I read that and tried it with no luck. Just points using all axis? Andy Quote The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do. Leadwerks Game-Ready 3D Models:https://sellfy.com/gib3d Link to comment Share on other sites More sharing options...
Josh Posted September 25, 2013 Share Posted September 25, 2013 The axis argument is the axis to point, and I think he wants control of the axis it rotates around. If you want to rotate around the Y axis, find the XZ vector between the two entities. Something like this will do it: Vec2 v = entity0->GetPosition(true).xz() - entity1->GetPosition(true).xz(); float angle = Math::ATan2(v.y,v.x); entity0->SetRotation(0,angle,0); Quote My job is to make tools you love, with the features you want, and performance you can't live without. 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.