generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Changing the direction of a LookVector

Previous Thread :: Next Thread 
edenojack is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. edenojack
Joined: 18 Jul 2008
Total Posts: 989
20 Oct 2015 06:10 PM
Cheers :)
Report Abuse
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image