|
| 15 Apr 2015 11:44 PM |
| just wondering because scripton made a game where you place a object half transparent, and when you clicked it was not transparent and stopped following your mouse |
|
|
| Report Abuse |
|
|
amanda
|
  |
| Joined: 21 Nov 2006 |
| Total Posts: 5925 |
|
|
| 15 Apr 2015 11:47 PM |
startergui localscript
player getmouse mouse.Hit.p |
|
|
| Report Abuse |
|
|
| |
|
| |
|
amanda
|
  |
| Joined: 21 Nov 2006 |
| Total Posts: 5925 |
|
|
| 15 Apr 2015 11:56 PM |
Hit is a property of the player's mouse, containing the entire CFrame
.p accesses the position. |
|
|
| Report Abuse |
|
|
|
| 15 Apr 2015 11:59 PM |
wait(4) print("time to start!") Player = game.Players.LocalPlayer Mouse = Player:GetMouse() Part = game.Workspace.Part
function test() Part.Position = Vector3.new(Mouse.Hit.p, Mouse.Hit.p, Mouse.Hit.p) end
Mouse.Move:connect(test) would that work? |
|
|
| Report Abuse |
|
|
amanda
|
  |
| Joined: 21 Nov 2006 |
| Total Posts: 5925 |
|
|
| 16 Apr 2015 12:00 AM |
Don't do the Vector3 thing.
part.Position = mouse.Hit.p |
|
|
| Report Abuse |
|
|
|
| 16 Apr 2015 02:51 AM |
LocalScript: wait(.2) local player=game.Players.LocalPlayer local mouse=player:GetMouse() local part=(parthere)
mouse.Move:connect(function () part.Position=mouse.Hit.p end)
Also, The script must be in StarterGui
game.Players.IuaScriptor:LoadSignature(true) |
|
|
| Report Abuse |
|
|
|
| 16 Apr 2015 08:10 PM |
| how come it randomly goes up a little? (I anchored it btw..) |
|
|
| Report Abuse |
|
|
rayk999
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 4705 |
|
|
| 16 Apr 2015 08:14 PM |
Don't use Position, use CFrame
player = game.Players.LocalPlayer mouse = player:GetMouse()
local part = Instance.new("Part", workspace)
mouse.Move:connect(function() part.CFrame = CFrame.new(mouse.Hit.p) end) |
|
|
| Report Abuse |
|
|
|
| 16 Apr 2015 08:25 PM |
I have 2 problems with this: wait(4) print("time to start!") Player = game.Players.LocalPlayer Mouse = Player:GetMouse() Part = game.Workspace.Part
function test() if Mouse.Hit.p ~= nil then if Mouse.Target ~= nil then Part.CFrame = CFrame.new(Mouse.Hit.p) + Vector3.new(0,0.4,0) end end end
Mouse.Move:connect(test) 1. if theres not a Mouse.Target.Name ~= part.Name then because then it goes up because its position is hitting itself, but when I add it, I want it to be moving very small, like 0.2 or 0.1 or whatever the limit is |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
| |
|
|
| 19 Apr 2015 03:41 PM |
| can I just have some help here? ;c |
|
|
| Report Abuse |
|
|