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: Need help with rotation!

Previous Thread :: Next Thread 
Zorbon61 is not online. Zorbon61
Joined: 05 Jun 2012
Total Posts: 321
26 Jan 2015 05:10 PM
local mouse = lp:GetMouse()
mouse.Move:connect(function()
if char then
if torso then
local rotation = Vector3.new(mouse.Hit.p.X, 0, mouse.Hit.p.Z)
torso.CFrame = CFrame.new(torso.Position, rotation)
end
end
end)

How do I make it so my character stand up straight at all times instead of his torso looking down/up? I don't get it, I set the Y to 0... Any help is appreciated!
Report Abuse
Zorbon61 is not online. Zorbon61
Joined: 05 Jun 2012
Total Posts: 321
26 Jan 2015 05:30 PM
Bump
Report Abuse
Zorbon61 is not online. Zorbon61
Joined: 05 Jun 2012
Total Posts: 321
26 Jan 2015 06:12 PM
In case anybody is confused, the issue is within the scripts;

local rotation = Vector3.new(mouse.Hit.p.X, 0, mouse.Hit.p.Z)
torso.CFrame = CFrame.new(torso.Position, rotation)

Instead of my guy walking straight like a normal guy, his whole body will look towards my mouse cursor. I don't understand why he just turns towards it, rather than his body leaning towards (and sometimes floating when cursor is under him) the cursor.

Imagine it like this, I want him to stand straight | rather than slanted / or in a case where the cursor is under him, completely horizontal -

Why is the Y being changed from 0?
Report Abuse
bigbadbob234 is not online. bigbadbob234
Joined: 26 Mar 2009
Total Posts: 64
26 Jan 2015 06:35 PM
local rotation = Vector3.new(mouse.Hit.p.X, 5, mouse.Hit.p.Z) --Try this instead
Report Abuse
iwishforpie1 is not online. iwishforpie1
Joined: 20 Mar 2011
Total Posts: 1423
26 Jan 2015 06:36 PM
local rotation = (somethin,torso.Position.Y,somethin)
Report Abuse
Zorbon61 is not online. Zorbon61
Joined: 05 Jun 2012
Total Posts: 321
26 Jan 2015 06:38 PM
Just tried that, I also attempted using 4. They were both pretty good, however when the cursor got close to the character, the character flipped out. Hmmm
Report Abuse
Zorbon61 is not online. Zorbon61
Joined: 05 Jun 2012
Total Posts: 321
26 Jan 2015 06:40 PM
Thanks a ton iwishforpie1! Didn't think of that. Thanks again!
Report Abuse
iwishforpie1 is not online. iwishforpie1
Joined: 20 Mar 2011
Total Posts: 1423
26 Jan 2015 06:58 PM
np
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