letris
|
  |
| Joined: 17 Dec 2012 |
| Total Posts: 572 |
|
|
| 17 Jun 2017 06:26 PM |
| the only thing that isnt working in game is changing the rocks velocity, anyone know why? local mouse = game.Players.LocalPlayer:GetMouse() mouse.KeyDown:connect(function(key) if key == "a" then workspace.rock.Velocity = ###################### ###### ### == "d" then workspace.rock.Velocity = ####################### ###### ### == "w" then workspace.rock.Velocity = Vector3.new(0,100,50) wait(0.5) workspace.rock.Velocity = Vector3.new(0,-20,50) wait(0.5) workspace.rock.Velocity = Vector3.new(0,0,50) wait(1) end end) |
|
|
| Report Abuse |
|
|
letris
|
  |
| Joined: 17 Dec 2012 |
| Total Posts: 572 |
|
|
| 17 Jun 2017 06:27 PM |
wow....
pastebin / Z C c T t f V D |
|
|
| Report Abuse |
|
|
letris
|
  |
| Joined: 17 Dec 2012 |
| Total Posts: 572 |
|
|
| 17 Jun 2017 06:38 PM |
| i just want to know why it wont change the velocity of the part when a key is pressed |
|
|
| Report Abuse |
|
|
letris
|
  |
| Joined: 17 Dec 2012 |
| Total Posts: 572 |
|
| |
|
|
| 17 Jun 2017 07:33 PM |
Try using UserInputService instead
local uis = game:GetService("UserInputService")
uis.InputBegan:connect(function(input, gameprocessed)
if input.KeyCode == Enum.KeyCode.A then --code end end) |
|
|
| Report Abuse |
|
|
letris
|
  |
| Joined: 17 Dec 2012 |
| Total Posts: 572 |
|
|
| 17 Jun 2017 07:45 PM |
| still doesnt work, it gets input from the keys, but it wont change the parts velocity |
|
|
| Report Abuse |
|
|
|
| 17 Jun 2017 07:48 PM |
| Try putting it in a server script not local. |
|
|
| Report Abuse |
|
|
letris
|
  |
| Joined: 17 Dec 2012 |
| Total Posts: 572 |
|
|
| 17 Jun 2017 07:53 PM |
| putting it in a serverscript makes nothing work, its the velocity that doesnt want to change, why is the velovity not changing? |
|
|
| Report Abuse |
|
|
|
| 17 Jun 2017 07:54 PM |
| Wait are you trying to make the rock move? If so, Velocity makes it act as a conveyor, but doesn't move it.. |
|
|
| Report Abuse |
|
|
letris
|
  |
| Joined: 17 Dec 2012 |
| Total Posts: 572 |
|
|
| 17 Jun 2017 07:57 PM |
https://www.youtube.com/watch?v=my9vm3tIJHU&feature=youtu.be
this is what its supposed to do. by changing the velocity it does whats shown in the viedo. but in game is does nothing |
|
|
| Report Abuse |
|
|
|
| 17 Jun 2017 08:06 PM |
| Velocity is not a constant force, you must constantly set the velocity. |
|
|
| Report Abuse |
|
|
|
| 17 Jun 2017 08:09 PM |
| Do you have FilteringEnabled on? If so, is this compatible with it? |
|
|
| Report Abuse |
|
|
Dev_Cos
|
  |
| Joined: 22 Oct 2016 |
| Total Posts: 83 |
|
|
| 17 Jun 2017 08:28 PM |
| Is the script a "Script" or a "Local Script". |
|
|
| Report Abuse |
|
|
letris
|
  |
| Joined: 17 Dec 2012 |
| Total Posts: 572 |
|
|
| 17 Jun 2017 08:31 PM |
It's in a local script and filtering enabled is off. I'm guessing i would need to do something like this:
While true do Part.velocity = Part.Velocity + Vector3.new (10,0,0) Wait () end |
|
|
| Report Abuse |
|
|
|
| 17 Jun 2017 08:34 PM |
| Since it works in studio, then it has to be related to client/server. Where do you have the script in? |
|
|
| Report Abuse |
|
|
|
| 17 Jun 2017 08:34 PM |
| If that's the direction you're getting at. But the overall point of constantly setting the velocity is correct, yes. |
|
|
| Report Abuse |
|
|
Dev_Cos
|
  |
| Joined: 22 Oct 2016 |
| Total Posts: 83 |
|
|
| 17 Jun 2017 08:39 PM |
| I've had this problem. I solved it by simply adding wait(1) at the beginning of the script. If it does not work, I really apologize for wasting your time. I'm not an expert but I just wanted to help. |
|
|
| Report Abuse |
|
|