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
|
  |
| Joined: 07 Jun 2008 |
| Total Posts: 5483 |
|
| |
|
|
| 18 Jan 2012 05:10 PM |
| Its '+1' thats confusing it. You need to use Vector3. |
|
|
| Report Abuse |
|
|
|
| 18 Jan 2012 05:11 PM |
| What's the +1 for? Do you mean +Vector3.new(1,1,1)? |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 18 Jan 2012 05:14 PM |
| Im assuming 'speed' is a vector3? |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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
|
  |
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|