|
| 09 Jun 2013 12:17 PM |
So - here's part of my script (the variables are above in the script, this is an extract):
mouse.Move:connect(function() cambrick.CFrame=CFrame.new(cambrick.Position,mouse.Hit.p) mouse.KeyDown:connect(function(walk) if walk=="w" then cambrick.CFrame=CFrame.new(cambrick.CFrame+cambrick.CFrame.lookVector*1) end end) end)
Now, this makes the camera leap forward a long way, why? I assume it should only leap forwards a stud, which is what I'm trying to make it do. Any ideas?
|
|
|
| Report Abuse |
|
|
|
| 09 Jun 2013 12:20 PM |
Sorry, I meant:
mouse.Move:connect(function() cambrick.CFrame=CFrame.new(cambrick.Position,mouse.Hit.p) mouse.KeyDown:connect(function(walk) if walk=="w" then cambrick.CFrame=CFrame.new(cambrick.Position+cambrick.CFrame.lookVector*1) end end) end)
Any ideas why? The camera brick is meant to follow the mouse, and W is meant to make it go forwards a stud. |
|
|
| Report Abuse |
|
|
|
| 09 Jun 2013 12:47 PM |
Bump, anyone? All I need to know is what to do, to stop it from leaping 50 studs. |
|
|
| Report Abuse |
|
|
iceywind
|
  |
| Joined: 10 Aug 2009 |
| Total Posts: 4424 |
|
|
| 09 Jun 2013 12:53 PM |
I forgot what LookVector was. Sorry, but I can't help out at the moment, not until I get the definition of a LookVector.
Making ROBLOX Better, One Forum Post at a Time™. |
|
|
| Report Abuse |
|
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
|
| 09 Jun 2013 01:27 PM |
@Oysi It works fine in the .Move connection for me. Tried what you suggested. It still appears to leap a really far distance for no reason. I'll try to explain. The part is at 0,0,0. After pressing W and having my mouse on the far end of the baseplate, it travels in that direction, but looks like it travels 5x as far as its meant to.
After asking @RenderSettings he suggested to * CFrame.new(5,0,0) instead of what you said. I get the same result.
I don't see any reason why it does this. |
|
|
| Report Abuse |
|
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
|
| 09 Jun 2013 01:35 PM |
@Oysi ok - now I feel stupid thanks lol
was just about to smash my screen in |
|
|
| Report Abuse |
|
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|