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 » Scripting Helpers
Home Search
 

Re: lookVector

Previous Thread :: Next Thread 
ZizZazZuz is not online. ZizZazZuz
Joined: 16 Jun 2008
Total Posts: 2743
07 Mar 2012 03:37 PM
I have a brick that is pointing slightly up. How do I get it's lookVector not to point up, but keep the other two axis?
Report Abuse
WhoBloxedWho is not online. WhoBloxedWho
Joined: 25 Mar 2009
Total Posts: 4611
07 Mar 2012 03:46 PM
So basically you want the 2 of the axises to stay the same, but one to change to an angle that would make the bricks flat?

Report Abuse
ZizZazZuz is not online. ZizZazZuz
Joined: 16 Jun 2008
Total Posts: 2743
07 Mar 2012 03:50 PM
Yeah. Is that the Y-axis?
Report Abuse
WhoBloxedWho is not online. WhoBloxedWho
Joined: 25 Mar 2009
Total Posts: 4611
07 Mar 2012 03:54 PM
Depends on the bricks CFrame really.

Y axis is typically it's spinning rotation(given the top surface it facing up, and the front surface is facing forward)

X axis is typically it's Left and Right rotation(given the top surface it facing up, and the front surface is facing forward)

Z axis is typically it's Front and Back rotation (given the top surface it facing up, and the front surface is facing forward)


Really you just have to mess with it, That code I have you in the other forum post can be modified to make your problem work, it just takes some tweaking in the CFrame part of the script.
Report Abuse
ZizZazZuz is not online. ZizZazZuz
Joined: 16 Jun 2008
Total Posts: 2743
07 Mar 2012 04:00 PM
Say the front face is facing up. I want the lookVector, and I want to cancel out the X/Y/Z axis, depending on which is making it look up.
Report Abuse
WhoBloxedWho is not online. WhoBloxedWho
Joined: 25 Mar 2009
Total Posts: 4611
07 Mar 2012 04:05 PM
part = YourPartHere

local AxisX = (Vector3.new(part.CFrame:toEulerAnglesXYZ()).x)
local AxisY = (Vector3.new(part.CFrame:toEulerAnglesXYZ()).y)
local AxisZ = (Vector3.new(part.CFrame:toEulerAnglesXYZ()).z)
part.CFrame = part.CFrame.LookVector * CFrame.Angles(0,0,-Axis)


TBH I dont know if it will work, but im fairly confident the Z axis is going to typically be the bricks up down rotation(as long as you keep in mind what i said in my last post)


Like I said, just mess with it, I have you access to the 3 rotation axis parts of the part, just see what works.


Report Abuse
Oysi is not online. Oysi
Joined: 06 Jul 2009
Total Posts: 9058
07 Mar 2012 04:18 PM
[ Content Deleted ]
Report Abuse
ZizZazZuz is not online. ZizZazZuz
Joined: 16 Jun 2008
Total Posts: 2743
07 Mar 2012 04:24 PM
It's not 'looking at' anything. It's just rotated. I just want to make something like:

lookVector * Vector3.new(1 or 0, 1 or 0, 1 or 0)

1 is for ones that are not making it point up (Should be two numbers), 0 is for the one that is.
Report Abuse
Oysi is not online. Oysi
Joined: 06 Jul 2009
Total Posts: 9058
07 Mar 2012 04:26 PM
[ Content Deleted ]
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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