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 » Scripters
Home Search
 

Re: how do I set a part's position to my mouse?

Previous Thread :: Next Thread 
TheScripterGeek is not online. TheScripterGeek
Joined: 02 Sep 2012
Total Posts: 1192
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 is not online. amanda
Joined: 21 Nov 2006
Total Posts: 5925
15 Apr 2015 11:47 PM
startergui
localscript

player
getmouse
mouse.Hit.p
Report Abuse
TheScripterGeek is not online. TheScripterGeek
Joined: 02 Sep 2012
Total Posts: 1192
15 Apr 2015 11:49 PM
whats mouse.Hit.p?
Report Abuse
TheScripterGeek is not online. TheScripterGeek
Joined: 02 Sep 2012
Total Posts: 1192
15 Apr 2015 11:54 PM
bump...
Report Abuse
amanda is not online. 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
TheScripterGeek is not online. TheScripterGeek
Joined: 02 Sep 2012
Total Posts: 1192
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 is not online. 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
IuaScriptor is not online. IuaScriptor
Joined: 04 Dec 2013
Total Posts: 58
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
TheScripterGeek is not online. TheScripterGeek
Joined: 02 Sep 2012
Total Posts: 1192
16 Apr 2015 08:10 PM
how come it randomly goes up a little? (I anchored it btw..)
Report Abuse
rayk999 is not online. 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
TheScripterGeek is not online. TheScripterGeek
Joined: 02 Sep 2012
Total Posts: 1192
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
TheScripterGeek is not online. TheScripterGeek
Joined: 02 Sep 2012
Total Posts: 1192
16 Apr 2015 08:30 PM
bump 2
Report Abuse
TheScripterGeek is not online. TheScripterGeek
Joined: 02 Sep 2012
Total Posts: 1192
16 Apr 2015 08:40 PM
bump 3
Report Abuse
TheScripterGeek is not online. TheScripterGeek
Joined: 02 Sep 2012
Total Posts: 1192
17 Apr 2015 08:20 PM
BUUUUMP(2 days later..)
Report Abuse
TheScripterGeek is not online. TheScripterGeek
Joined: 02 Sep 2012
Total Posts: 1192
17 Apr 2015 09:07 PM
BUMP -_-
Report Abuse
TheScripterGeek is not online. TheScripterGeek
Joined: 02 Sep 2012
Total Posts: 1192
19 Apr 2015 03:41 PM
can I just have some help here? ;c
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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