|
| 21 Dec 2015 05:00 PM |
function CFrameLookAt(Pos1, Pos2, UpVector) local UpVector = UpVector or Vector3.new(0,1,0) local NormalizedDirection = (Pos2 - Pos1).unit
local XAxis = NormalizedDirection:Cross(UpVector).unit local UpAxis = XAxis:Cross(NormalizedDirection).unit return CFrame.new( Pos1.X, Pos1.Y, Pos1.Z, 1, 0, 0, 0, UpAxis.Y, -NormalizedDirection.Y, 0, UpAxis.Z, -NormalizedDirection.Z ) end
i have this function, but when i my character walk back, it doesn't rotates and the part gets inverted
could someone help me? |
|
|
| Report Abuse |
|
|
| |
|
XIPokezIX
|
  |
| Joined: 24 Sep 2015 |
| Total Posts: 381 |
|
| |
|
|
| 21 Dec 2015 05:29 PM |
| what? just some vectors... |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
| |
|
| |
|
Vultorz
|
  |
| Joined: 02 Mar 2015 |
| Total Posts: 2985 |
|
|
| 22 Dec 2015 12:29 PM |
| Are there any errors in the output? |
|
|
| Report Abuse |
|
|
|
| 22 Dec 2015 02:07 PM |
| no, just the part going inverse when i walk back and my character turns 180 degrees... |
|
|
| Report Abuse |
|
|