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: !! [LOOKVECTOR] !!

Previous Thread :: Next Thread 
dudefun1234 is not online. dudefun1234
Joined: 21 Jul 2013
Total Posts: 3038
27 Jul 2016 02:12 AM
If I set a BodyVelocity's Velocity to the look Vectors of a brick, will it move forward or in the direction if the front of the brick?

Example


BodyVelocity.Velocity = Vector3.new(Part.CFrame.LookVector)

Will that move the brick forward?
Report Abuse
thedailyblarg is not online. thedailyblarg
Joined: 26 Feb 2012
Total Posts: 5506
27 Jul 2016 02:13 AM
lookVector is a Unit Vector, why the heck would you make a Vector3 using something that already is a Vector3?

lookVector is 1 stud in the direction the part is facing.
Report Abuse
dudefun1234 is not online. dudefun1234
Joined: 21 Jul 2013
Total Posts: 3038
27 Jul 2016 02:14 AM
So no. Thats all I needed, thank you.
Report Abuse
dudefun1234 is not online. dudefun1234
Joined: 21 Jul 2013
Total Posts: 3038
27 Jul 2016 02:15 AM
You have to btw. You will get an error. How long have you been using lua :/
Report Abuse
thedailyblarg is not online. thedailyblarg
Joined: 26 Feb 2012
Total Posts: 5506
27 Jul 2016 02:17 AM
Here is the thing.

Part.CFrame.lookVector is the direction that the brick is facing.

It is measured in 1 STUD

Say a brick was aiming to the left

lookVector would be: {1,0,0} because 1 stud in the direction it is looking will be on the X axis.

This means that Part.CFrame + Part.CFrame.lookVector * speed

will move the part in its direction and since the lookVector is only 1 stud, to change the amount of studs passed every time it is ran, multiply it by speed.
Report Abuse
thedailyblarg is not online. thedailyblarg
Joined: 26 Feb 2012
Total Posts: 5506
27 Jul 2016 02:17 AM
And no, the correct way is Velocity = obj.CFrame.lookVector

not Velocity = Vector3(obj.CFrame.lookVector)

Report Abuse
dudefun1234 is not online. dudefun1234
Joined: 21 Jul 2013
Total Posts: 3038
27 Jul 2016 02:19 AM
So I am right. Your no help, I just figured it out using my method, I had a variable wrong thats why it didnt work.
Report Abuse
sioux123 is not online. sioux123
Joined: 18 Nov 2011
Total Posts: 970
27 Jul 2016 04:01 AM
Idk if this is relevant anymore
But CFrame.lookVector returns a unit(1 magnitude vector going directly off the face of the part)

If you did part.Position + part.CFrame.lookVector you would get it to go in the direction of the face by 1 stud i'm pretty sure
Report Abuse
Flux_Capacitor is not online. Flux_Capacitor
Joined: 07 Apr 2008
Total Posts: 45720
27 Jul 2016 04:02 AM
No. You were wrong OP.
"Vector3.new(Part.CFrame.lookVector)" ends you up with a Vector3 with all 3 components being 0. Get over yourself.
Report Abuse
VoidFrost is not online. VoidFrost
Joined: 14 Oct 2011
Total Posts: 1188
27 Jul 2016 04:13 AM
op confirmed stupido
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