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
 

How can I move a brick to the mouse coordinates?

Previous Thread :: Next Thread 
RocketScientist50 is not online. RocketScientist50
Joined: 01 Nov 2015
Total Posts: 239
17 Jun 2017 10:30 AM
Just curious.


print("hello fourm")
Report Abuse
Gomlsauresrex is not online. Gomlsauresrex
Joined: 25 Mar 2016
Total Posts: 3588
17 Jun 2017 10:34 AM
local rs=game:GetService("RunService")
local player=game.Players.LocalPlayer
local mouse=player:GetMouse()
local part=workspace.Part

mouse.TargetFilter=part

rs.RenderStepped:Connect(function()
part.Position=mouse.Hit.p
end)
Report Abuse
RocketScientist50 is not online. RocketScientist50
Joined: 01 Nov 2015
Total Posts: 239
17 Jun 2017 10:38 AM
bumpity


print("hello fourm")
Report Abuse
RocketScientist50 is not online. RocketScientist50
Joined: 01 Nov 2015
Total Posts: 239
17 Jun 2017 04:16 PM
bump


print("hello fourm")
Report Abuse
Vangief is not online. Vangief
Joined: 28 May 2017
Total Posts: 66
17 Jun 2017 04:20 PM
easy. Just use mouse hit, its a cframe though. im sure you can make it into a vector3. ##########################################################
Report Abuse
MidasTouched is not online. MidasTouched
Joined: 02 Dec 2016
Total Posts: 242
17 Jun 2017 04:20 PM
You got an answer. Stop bumping. Mouse.Hit projects the mouse position into the 3D landscape giving you a position to move the brick to.
Report Abuse
Vangief is not online. Vangief
Joined: 28 May 2017
Total Posts: 66
17 Jun 2017 04:20 PM
##########################################################
Report Abuse
Vangief is not online. Vangief
Joined: 28 May 2017
Total Posts: 66
17 Jun 2017 04:21 PM
wiki.roblox.com/index.php?title=API:Class/Mouse/Hit
Report Abuse
Gomlsauresrex is not online. Gomlsauresrex
Joined: 25 Mar 2016
Total Posts: 3588
18 Jun 2017 10:13 AM
Mouse.Hit returns a CFrame value of the mouse's coordinates.

Mouse.Hit.p returns a Vector3 value of the mouse's coordinates.

Mouse.Hit.p returns the position of the mouse in the 3d space.
Report Abuse
kojocrash is not online. kojocrash
Joined: 07 Sep 2013
Total Posts: 277
18 Jun 2017 10:24 AM
game.Players.LocalPlayer:GetMouse().Move:connect(function()
Part.CFrame = mouse.Hit
end)
Report Abuse
Gomlsauresrex is not online. Gomlsauresrex
Joined: 25 Mar 2016
Total Posts: 3588
18 Jun 2017 10:26 AM
@kojo

It's better to use a RenderStepped event or a BindToRenderStep function.
Report Abuse
kojocrash is not online. kojocrash
Joined: 07 Sep 2013
Total Posts: 277
18 Jun 2017 10:33 AM
@Gomlsauresrex

I like using the move function because on the player's screen, stuff is smooth but not for others because other people render at different times

But thanks though, there is barely a difference, In this case I dont think it should matter
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