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
 

Help (Not so hard)

Previous Thread :: Next Thread 
GrimReaper5908 is not online. GrimReaper5908
Joined: 13 Feb 2012
Total Posts: 181
13 Aug 2015 02:20 PM
This script allows my characters' torso to look or "face" the direction of my mouse. But sometimes, depending on where I move my mouse, it'll makes my body fly all over the baseplate. How can I fix this code? This script is located in the Handle of a tool.

script.Parent.Parent.Equipped:connect(function (mouse)
mouse.Move:connect(function ()
local t = script.Parent.Parent.Parent.Torso;
t.CFrame = CFrame.new(t.Position, mouse.Hit.p);
end);
end);
Report Abuse
Zaxerion is not online. Zaxerion
Joined: 09 Feb 2013
Total Posts: 2304
13 Aug 2015 02:23 PM
script.Parent.Parent.Equipped:connect(function (mouse)
mouse.Move:connect(function ()
local t = script.Parent.Parent.Parent.Torso;
t.CFrame = CFrame.new(mouse.Hit.p.X,t.CFrame.p.Y,mouse.Hit.p.Z);
end);
end);

try that?

Zaxerion/McChicken72, iSpecializinq, TheNewChicken, alot of others. Add approx 5k posts.
Report Abuse
GrimReaper5908 is not online. GrimReaper5908
Joined: 13 Feb 2012
Total Posts: 181
13 Aug 2015 02:38 PM
Hmm. It made me teleport to places unknown whenever my mouse moved. Bump?
Report Abuse
Zaxerion is not online. Zaxerion
Joined: 09 Feb 2013
Total Posts: 2304
13 Aug 2015 02:45 PM
script.Parent.Parent.Equipped:connect(function (mouse)
mouse.Move:connect(function ()
local t = script.Parent.Parent.Parent.Torso;
t.CFrame = t.CFrame*CFrame.Angles(mouse.Hit.p.X,t.CFrame.p.Y,mouse.Hit.p.Z);
end);
end);

Zaxerion/McChicken72, iSpecializinq, TheNewChicken, alot of others. Add approx 5k posts.
Report Abuse
GrimReaper5908 is not online. GrimReaper5908
Joined: 13 Feb 2012
Total Posts: 181
13 Aug 2015 02:54 PM
^ Made me rotate 360 degrees in every axis. Grateful that you're helping. Bump.
Report Abuse
Zaxerion is not online. Zaxerion
Joined: 09 Feb 2013
Total Posts: 2304
13 Aug 2015 03:08 PM
sorry

Zaxerion/McChicken72, iSpecializinq, TheNewChicken, alot of others. Add approx 5k posts.
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