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 would I get a something to just look at your mouse?

Previous Thread :: Next Thread 
DesiredROBLOXlAN is not online. DesiredROBLOXlAN
Joined: 01 Mar 2012
Total Posts: 971
04 Aug 2016 11:42 PM
Been searching on roblox wiki for an hour now...


~The most desired of Robloxians
Report Abuse
DesiredROBLOXlAN is not online. DesiredROBLOXlAN
Joined: 01 Mar 2012
Total Posts: 971
04 Aug 2016 11:45 PM
To clarify I want the player's head to follow your mouse.


~The most desired of Robloxians
Report Abuse
DesiredROBLOXlAN is not online. DesiredROBLOXlAN
Joined: 01 Mar 2012
Total Posts: 971
05 Aug 2016 01:14 AM
Nobody can tell me?


~The most desired of Robloxians
Report Abuse
gmatch is not online. gmatch
Joined: 21 May 2014
Total Posts: 1173
05 Aug 2016 01:15 AM
http://wiki.roblox.com/index.php?title=CFrame


idk


Report Abuse
BrendonTheWizard is online. BrendonTheWizard
Joined: 28 Jul 2010
Total Posts: 25709
05 Aug 2016 01:18 AM
you're asking for something specific

http://wiki.roblox.com/index.php?title=API:Class/Mouse

you'll be able to get the mouse's position but to make the head cframe itself to look at it would be somewhat complicated

your mouse's is position is 2d and the head's position is 3d
Report Abuse
DesiredROBLOXlAN is not online. DesiredROBLOXlAN
Joined: 01 Mar 2012
Total Posts: 971
05 Aug 2016 01:19 AM
Am I able to manipulate the torso's lookvector to face the mouse?


~The most desired of Robloxians
Report Abuse
Kodran is not online. Kodran
Joined: 15 Aug 2013
Total Posts: 5330
05 Aug 2016 01:20 AM
If you provide two vector3 values when creating a cframe the first vector is the position, the second is where it's looking at. For example:

local p = Instance.new("Part", workspace)
local plr = game.Players.LocalPlayer
local m = plr:GetMouse()
p.Anchored = true
while wait() do
p.CFrame = CFrame.new(p.CFrame.p, m.Hit.p)
end
Report Abuse
Weirdraidercs35 is not online. Weirdraidercs35
Joined: 14 May 2015
Total Posts: 2275
05 Aug 2016 01:21 AM
^yes but when I did that, my body got all jerky and kept on tripping
so don't do it


im a mlg
Report Abuse
DesiredROBLOXlAN is not online. DesiredROBLOXlAN
Joined: 01 Mar 2012
Total Posts: 971
05 Aug 2016 01:31 AM
Okay so I got this so far,


wait(0.5)
local Mouse = game.Players.LocalPlayer:GetMouse()
local Head = game.Workspace:FindFirstChild(game.Players.LocalPlayer.Name):WaitForChild("Head")

while true do
wait()
Head.CFrame = CFrame.new(Head.CFrame.p, Mouse.Hit.p)
end

But in order to fix it from being so jerky how do I keep the head from changing the position that makes it look down or up?


~The most desired of Robloxians
Report Abuse
Weirdraidercs35 is not online. Weirdraidercs35
Joined: 14 May 2015
Total Posts: 2275
05 Aug 2016 01:36 AM
that is because you are using a while true which has a limit of wat ever wait you put in it
use camera.Changed (it updates every time your camera changes)


im a mlg
Report Abuse
DesiredROBLOXlAN is not online. DesiredROBLOXlAN
Joined: 01 Mar 2012
Total Posts: 971
05 Aug 2016 01:39 AM
That's a lot better, but how would you keep the player from look down and up what you move your mouse?

sorry I'm still learning!


~The most desired of Robloxians
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