|
| 16 Sep 2017 11:28 AM |
Ok this sounds wierd, but I do not know what the heck I'm supposed to do, CFrame- A Position and An Orientation inherited from basepart. game.Players.LocalPlayers:getMouse().hit always returns CFrame, and I want to convert that CFrame into a position? And also, Vector3 is the value type for position and orientation, how am I supposed to select the position of or the orientation of from CFrame.new(Vector3)?
--script-- mouse = game.Players.LocalPlayers:getMouse() local part = Instance.new("Part")
function getMousePOSITION() part.CFrame = mouse.HIt --this is my problem, this is a CFrame and then i want the position from mouse.hit end
mouse.Move:connect(getMousePOSITION) |
|
|
| Report Abuse |
|
|
KapKing47
|
  |
| Joined: 09 Sep 2012 |
| Total Posts: 5522 |
|
| |
|
| |
|
|
| 16 Sep 2017 11:40 AM |
Thanks but this is my full thing, if i want to make building tools,
mouse = game.Players.LocalPlayer:getMouse() script.Parent.Activated:connect(function() mouse.TargetFilter = nil local part = Instance.new("Part") part.Size = Vector3.new(5, 5, 5) part.Parent = workspace part.Position = mouse.hit.p --Look over here part.Anchored = true end)
This make a block over at my mouse position but, anywhere i press, it will place the block on top of mouse.Target which is very annoying, cause its not CFrame |
|
|
| Report Abuse |
|
|
KapKing47
|
  |
| Joined: 09 Sep 2012 |
| Total Posts: 5522 |
|
|
| 16 Sep 2017 11:51 AM |
Ah, u want to keep the rotation of the part but also the position of the mouse?
local function merge(cf, v3) return (cf - cf.p) + v3 end
then
part.CFrame = merge(part.CFrame, mouse.Hit.p) --Change part.CFrame to a CFrame of which rotation u want to keep
|
|
|
| Report Abuse |
|
|