|
| 10 Mar 2017 11:27 AM |
(prntscr) /eicfh9
Is this accurate (assuming I don't need to go back and learn trigonometry all over again)? I tried it in a script and I get weird rotations. I want the camera to rotate on the Y axis (up and down) relative to the character's head. |
|
|
| Report Abuse |
|
|
RogueMage
|
  |
| Joined: 28 Jan 2012 |
| Total Posts: 1235 |
|
|
| 10 Mar 2017 11:30 AM |
| I think you have to rotate it on the X-axis or Z-axis as you're rotating up and down. If you think about it like bars, then when you rotate up and down you're rotating along a horizontal bar (x and z), not a vertical bar(y). |
|
|
| Report Abuse |
|
|
|
| 10 Mar 2017 11:52 AM |
| I'm not sure what you mean. Could you elaborate a little? |
|
|
| Report Abuse |
|
|
|
| 12 Mar 2017 04:24 AM |
I've tried math.atan2() and it works to an extent - but when I use my mouse to move the character (mouse is locked in the center of the screen), the angle starts going crazy.
Does anyone know why this is happening? |
|
|
| Report Abuse |
|
|
|
| 12 Mar 2017 04:25 AM |
atan2 gives angles between -90 and 90
|
|
|
| Report Abuse |
|
|
|
| 12 Mar 2017 04:25 AM |
wait nvm didn't read your thing right
|
|
|
| Report Abuse |
|
|
|
| 12 Mar 2017 04:31 AM |
https://www.roblox.com/games/673627868/Space
Here's what I've got if you want to see for yourself. |
|
|
| Report Abuse |
|
|
| |
|
Zylez
|
  |
| Joined: 26 Mar 2016 |
| Total Posts: 417 |
|
|
| 12 Mar 2017 05:41 AM |
vector = Pos2 - Pos1
angle = math.deg(math.atan(Vector.X/Vector.Z)) |
|
|
| Report Abuse |
|
|