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: Does LookVector still work?

Previous Thread :: Next Thread 
mityguy is not online. mityguy
Joined: 07 Jun 2008
Total Posts: 5483
18 Jan 2012 05:06 PM
When I run this:
gyro.velocity = mp.CFrame.lookVector * speed + 1

I get this wierd error, is lookvector different now? I've always ran it like that (above)

Workspace.CarRemake1.Body.VehicleSeat.Throttle:11: bad argument #2 to '?' (Vector3 expected, got number)
Report Abuse
mityguy is not online. mityguy
Joined: 07 Jun 2008
Total Posts: 5483
18 Jan 2012 05:10 PM
No comments?
Report Abuse
Penguine236 is not online. Penguine236
Joined: 13 Apr 2011
Total Posts: 1303
18 Jan 2012 05:10 PM
Its '+1' thats confusing it. You need to use Vector3.
Report Abuse
epicfail22 is not online. epicfail22
Joined: 25 Sep 2009
Total Posts: 3739
18 Jan 2012 05:11 PM
What's the +1 for? Do you mean +Vector3.new(1,1,1)?
Report Abuse
mityguy is not online. mityguy
Joined: 07 Jun 2008
Total Posts: 5483
18 Jan 2012 05:13 PM
No I'm adding to the value Speed. Its worked before but if you guys say so.
Report Abuse
Penguine236 is not online. Penguine236
Joined: 13 Apr 2011
Total Posts: 1303
18 Jan 2012 05:14 PM
Im assuming 'speed' is a vector3?
Report Abuse
Shobobo99 is not online. Shobobo99
Joined: 30 Dec 2008
Total Posts: 5754
18 Jan 2012 05:16 PM
gyro.velocity = mp.CFrame.lookVector * (speed + 1)

Order of operations was ruining it.
Report Abuse
Penguine236 is not online. Penguine236
Joined: 13 Apr 2011
Total Posts: 1303
18 Jan 2012 05:18 PM
@Sho

Order of operation isnt really the problem here. Even if it was a problem with OO(Order of operation), then it would still work.
Report Abuse
blockoo is not online. blockoo
Joined: 08 Nov 2007
Total Posts: 17202
18 Jan 2012 05:21 PM
@Penguine
Actually, it does matter here.

Vector3.new(x, y, z) * 2 + n

Order of operations says, multiply (x, y, z) by 2 first, which is a legal operation.

Vector3.new(2x, 2y, 2z) + n

Then it says to add n to (2x, 2y, 2z), which is illegal.
Using parentheses tells it to multiply by the sum of 2 and n.

~Would you like some butter with that latetoast?
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
18 Jan 2012 05:35 PM
Most people that posted here don't have the slightest clue on how to use lookVector, and what it is.

­<'+1 Post. Ujelly?'>
Report Abuse
Penguine236 is not online. Penguine236
Joined: 13 Apr 2011
Total Posts: 1303
18 Jan 2012 05:35 PM
I know that. I was just saying that i dont think it would matter in this specific problem.
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
18 Jan 2012 05:36 PM
"Its '+1' thats confusing it. You need to use Vector3."

Doubt it^

­<'+1 Post. Ujelly?'>
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
18 Jan 2012 05:38 PM
He was trying to add one to the speed value. Vector3 wouldn't work like he wanted.
Though I supposed he could have done this:


velocity = lookVector * speed + lookVector


That's the same as:

velocity = lookVector * (speed + 1)
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