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: First Person vs 3rd with mouse.Hit.p

Previous Thread :: Next Thread 
lskid is online. lskid
Joined: 07 Dec 2012
Total Posts: 89
01 Apr 2017 11:55 AM
So, why is it that mouse.Hit.p only returns an accurate position of the mouse if the player is in first person? It's really beginning to bug me with the game I'm working on.


Lskid
Report Abuse
Wunder_Wulfe is online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
01 Apr 2017 12:25 PM
it is accurate in first and third person... your scripting is inaccurate or you could be hitting walls
Report Abuse
ur_famous is not online. ur_famous
Joined: 27 Mar 2013
Total Posts: 246
01 Apr 2017 12:27 PM
mouse.Hit.p should be returning the Vector3 of the CFrame you are pointing to, if anything happens then something is wrong with your game, maybe you have invisible bricks going around?


Signed, eiad999 - ur_famous ~ Holder of India ~ Holder of India of development ~ Founder of Legends Studios ~ Developer of Stormcage Containment Facility...
Report Abuse
lskid is online. lskid
Joined: 07 Dec 2012
Total Posts: 89
01 Apr 2017 03:47 PM
I've never seen it in anything else, but

If you point down, towards the surface you're on, it gets MORE accurate, but not dead on (Probably just the dampening) but if you point out to an object, it is all over the place, sometimes even turning in the opposite direction.


Lskid
Report Abuse
lskid is online. lskid
Joined: 07 Dec 2012
Total Posts: 89
01 Apr 2017 03:48 PM
The segment that controls it:

wait(1)
local players = game:GetService("Players")
local player = players[script.Parent.PlayerName.Value]
local mouse = player:GetMouse()
while true do
wait(1/10)
script.Parent.BodyGyro.cframe = mouse.Hit
end


Lskid
Report Abuse
lskid is online. lskid
Joined: 07 Dec 2012
Total Posts: 89
01 Apr 2017 03:50 PM
And yes, the object is rotated properly so that the front side faces the object it points to


Lskid
Report Abuse
graveyardposse is not online. graveyardposse
Joined: 23 Oct 2008
Total Posts: 2565
01 Apr 2017 03:59 PM
you could check if the part is part of a model, then return the primarypart's cframe instead
Report Abuse
lskid is online. lskid
Joined: 07 Dec 2012
Total Posts: 89
01 Apr 2017 04:00 PM
It needs to point to cursor position, not to a part


Lskid
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