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 do you get a vector3 value from a mouse

Previous Thread :: Next Thread 
shinybearhead is not online. shinybearhead
Joined: 24 Jan 2011
Total Posts: 135
22 Apr 2014 09:57 PM
I used selected from a hopperbin and now I want to return the value where the mouse is pointing at
is it possible? I was thinking of using targetposition but I do not get how it works except by the fact that it is where your character is going to walk (i'm assuming the green circle thing)
Report Abuse
shinybearhead is not online. shinybearhead
Joined: 24 Jan 2011
Total Posts: 135
22 Apr 2014 10:04 PM
bumppppp
Report Abuse
ninjaxrasx is not online. ninjaxrasx
Joined: 29 May 2008
Total Posts: 757
22 Apr 2014 10:06 PM
Mouses are not Vector3 (X,Y,Z) It's Vector2 (X,Y) since it's 2D. Search Roblox Wiki.
Report Abuse
shinybearhead is not online. shinybearhead
Joined: 24 Jan 2011
Total Posts: 135
22 Apr 2014 10:06 PM
would mouse.Target work or does mouse.target only return the position of the instance that the mouse is pointing to
Report Abuse
shinybearhead is not online. shinybearhead
Joined: 24 Jan 2011
Total Posts: 135
22 Apr 2014 10:08 PM
ok so it is not target, i am thinking of using rays
Report Abuse
DrMathematica is not online. DrMathematica
Joined: 29 Aug 2008
Total Posts: 27268
22 Apr 2014 10:17 PM
mouse.Hit.p will get the position the mouse is pointing at in Vector3
Report Abuse
shinybearhead is not online. shinybearhead
Joined: 24 Jan 2011
Total Posts: 135
22 Apr 2014 10:18 PM
HEEELP This is what I have so far

function intersectsSphere(ray, position, radius)
return ray:Distance(position) <= radius
end


script.Parent.Selected:connect(function(mouse)
print("HopperBin selected")
mouse.KeyDown:connect(function(key)
if key == "f" then print('f')
if intersectsSphere(mouse.UnitRay, mouse.Target.Position, mouse.Target.Size.X/2) then
end
else script.Parent.Parent.Parent.Character.Humanoid.TargetPoint = Vector3.new(0,0,0) end
end) end)

Now I have a function that returns a bool on whether it collids with another sphere or not, but it does not return a vector3 value! How would I make it so it can return a vector3 value from direction?

my real question is, how do I get direction (for the ray) from mouse!!!!???
Report Abuse
shinybearhead is not online. shinybearhead
Joined: 24 Jan 2011
Total Posts: 135
22 Apr 2014 10:19 PM
oh wow, thanks i really overcomplicated
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
22 Apr 2014 10:21 PM
Mouse.Hit.Position bruh.
Report Abuse
shinybearhead is not online. shinybearhead
Joined: 24 Jan 2011
Total Posts: 135
22 Apr 2014 10:22 PM
CFrame doesn't have a property called Position!!!!!!!!!!!!
Report Abuse
DrMathematica is not online. DrMathematica
Joined: 29 Aug 2008
Total Posts: 27268
22 Apr 2014 10:22 PM
"Mouse.Hit.Position bruh."

That's called an error. We don't like those in scripting.
Report Abuse
wubbzy301 is not online. wubbzy301
Joined: 15 May 2010
Total Posts: 1188
22 Apr 2014 10:24 PM
CFrame.p

Not CFrame.Position
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