edenojack
|
  |
| Joined: 18 Jul 2008 |
| Total Posts: 989 |
|
|
| 20 Oct 2015 06:06 PM |
I am trying to find the Up and Down lookVector, but I've completely forgotten how to find it, I remember vaguely its something like (CFrame.new(PointA,PointA*CFrame.new(0,1,0)).lookVector, but not how to properrly execute it :/ |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 20 Oct 2015 06:07 PM |
local upLookVector = cframe:vectorToWorldSpace(Vector3.new(0, 1, 0)); Which is doing the equiv. of: local upLookvector = (cframe - cframe.p) * Vector3.new(0, 1, 0);
|
|
|
| Report Abuse |
|
|
edenojack
|
  |
| Joined: 18 Jul 2008 |
| Total Posts: 989 |
|
|
| 20 Oct 2015 06:08 PM |
| But is that up in the parts global Y axis, or its Individual Y axis? (So if I tilt it, it goes up in that tilted direction) |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 20 Oct 2015 06:09 PM |
Local axes, so yes if you tilt it you will get a different result. If you always want "up", it'd just be Vector3.new(0, 1, 0) |
|
|
| Report Abuse |
|
|
edenojack
|
  |
| Joined: 18 Jul 2008 |
| Total Posts: 989 |
|
| |
|
|
| 20 Oct 2015 06:10 PM |
You want to modify parts based on local space?
Just take the current CFrame and translate it or rotate it.
Part.CFrame = Part.CFrame * CFrame.new(0,0,1) -- would make it go forward Part.CFrame = Part.CFrame * CFrame.Angles(math.rad(90),0,0) -- would make it rotate 90* forward |
|
|
| Report Abuse |
|
|