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 » Scripting Helpers
Home Search
 

Re: How to make part rotation same as mouse cframe

Previous Thread :: Next Thread 
BladeXE is not online. BladeXE
Joined: 22 Dec 2012
Total Posts: 3857
14 Aug 2014 07:47 PM
?
So, is it
arm=part
part.Rotation = mouse.Hit.P
or something?
Report Abuse
IAmTheRolo is online. IAmTheRolo
Joined: 12 Nov 2013
Total Posts: 859
14 Aug 2014 07:49 PM
Do you mean making a part point at the mouse?
Report Abuse
BladeXE is not online. BladeXE
Joined: 22 Dec 2012
Total Posts: 3857
14 Aug 2014 07:50 PM
basically, yes.
Report Abuse
IAmTheRolo is online. IAmTheRolo
Joined: 12 Nov 2013
Total Posts: 859
14 Aug 2014 07:51 PM
part.CFrame = CFrame.new(Vector3 origin, mouse.Hit.p)
Report Abuse
BladeXE is not online. BladeXE
Joined: 22 Dec 2012
Total Posts: 3857
14 Aug 2014 07:51 PM
Example: k rit z.n et
Play Citizen Burger Disorder
Like that.
Report Abuse
opplo is not online. opplo
Joined: 09 Dec 2008
Total Posts: 5320
14 Aug 2014 07:51 PM
Perfect
Report Abuse
BladeXE is not online. BladeXE
Joined: 22 Dec 2012
Total Posts: 3857
14 Aug 2014 07:53 PM
So I put that part's vector3 as Vector origin?
Report Abuse
IAmTheRolo is online. IAmTheRolo
Joined: 12 Nov 2013
Total Posts: 859
14 Aug 2014 07:54 PM
Yes, the origin is where you want the part to be at, and the second argument will make the front face look at that mouse.
Report Abuse
BladeXE is not online. BladeXE
Joined: 22 Dec 2012
Total Posts: 3857
14 Aug 2014 07:54 PM
ok
Report Abuse
BladeXE is not online. BladeXE
Joined: 22 Dec 2012
Total Posts: 3857
14 Aug 2014 07:55 PM
part=script.Parent
plr=game.Players.LocalPlayer
mouse = plr:GetMouse()
while wait() do
part.CFrame = CFrame.new(Vector3.new(-38.5, 103.196, 8.3), mouse.Hit.p)
end
?
Report Abuse
L0cky2013 is not online. L0cky2013
Joined: 30 Jul 2012
Total Posts: 1446
14 Aug 2014 07:56 PM
part=script.Parent
plr=game.Players.LocalPlayer
mouse = plr:GetMouse()
while wait() do
part.CFrame = CFrame.new(part.Position, mouse.Hit.p)
end
Report Abuse
BladeXE is not online. BladeXE
Joined: 22 Dec 2012
Total Posts: 3857
14 Aug 2014 07:58 PM
not working
Is this only for server scripts?
Report Abuse
L0cky2013 is not online. L0cky2013
Joined: 30 Jul 2012
Total Posts: 1446
14 Aug 2014 07:58 PM
no. Only for localscripts. And it works perfect for me.
Report Abuse
BladeXE is not online. BladeXE
Joined: 22 Dec 2012
Total Posts: 3857
14 Aug 2014 08:00 PM
Changed to server script and it worked
thanks guys.
Report Abuse
BladeXE is not online. BladeXE
Joined: 22 Dec 2012
Total Posts: 3857
14 Aug 2014 08:24 PM
And it only works in play solo both ways.
Report Abuse
BladeXE is not online. BladeXE
Joined: 22 Dec 2012
Total Posts: 3857
14 Aug 2014 08:27 PM
part=script.Parent
plr=game.Players.LocalPlayer
mouse = plr:GetMouse()
while true do
wait(0)
part.Rotation = CFrame.new(part.Position, mouse.Hit.p)
end
Report Abuse
IAmTheRolo is online. IAmTheRolo
Joined: 12 Nov 2013
Total Posts: 859
14 Aug 2014 08:27 PM
It has to be a local script to work online. And local scripts only work when it's under a descendant from a player (such as PlayerGui, Backpack, etc.)

part=PATH TO YOUR PART
plr=game.Players.LocalPlayer
mouse = plr:GetMouse()
while wait() do
part.CFrame = CFrame.new(part.Position, mouse.Hit.p)
end
Report Abuse
BladeXE is not online. BladeXE
Joined: 22 Dec 2012
Total Posts: 3857
14 Aug 2014 08:38 PM
Thanks rolo :)
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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