|
| 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 |
|
|
| |
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 22 Apr 2014 10:08 PM |
| ok so it is not target, i am thinking of using rays |
|
|
| Report Abuse |
|
|
|
| 22 Apr 2014 10:17 PM |
| mouse.Hit.p will get the position the mouse is pointing at in Vector3 |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 22 Apr 2014 10:19 PM |
| oh wow, thanks i really overcomplicated |
|
|
| Report Abuse |
|
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
| |
|
|
| 22 Apr 2014 10:22 PM |
| CFrame doesn't have a property called Position!!!!!!!!!!!! |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| Joined: 15 May 2010 |
| Total Posts: 1188 |
|
|
| 22 Apr 2014 10:24 PM |
CFrame.p
Not CFrame.Position |
|
|
| Report Abuse |
|
|