|
| 08 May 2016 11:42 AM |
is it just CFrame.new(1,1,1) * CFrame.Angles(0,0,math.rad(script.Parent.CFrame.lookVector))
?
It's simple physics |
|
|
| Report Abuse |
|
|
|
| 08 May 2016 11:53 AM |
lookVector is an XYZ value, not a single number. You should try something with the rotation matrix.
local part = game.Workspace.Part local otherPart = script.Parent.CFrame:components() --Not totally sure how to do this, but this is my best guess. part.CFrame = CFrame.new(otherPart)-Vector3.new(1,1,1) --Pretty sure this keeps rotation of otherPart but not position.
|
|
|
| Report Abuse |
|
|
|
| 08 May 2016 11:56 AM |
Extreme, you can't use the CFrame.new constructor like that can you? Only with a Vector3 value or Vector3 value + quaternion?
~~~Da siggy is OP~~~ |
|
|
| Report Abuse |
|
|
|
| 08 May 2016 11:56 AM |
Never mind, read the wiki.
~~~Da siggy is OP~~~ |
|
|
| Report Abuse |
|
|
|
| 08 May 2016 12:01 PM |
| I just tested it out, it's expecting a vector3 for some reason, have I misunderstood components()? |
|
|
| Report Abuse |
|
|
|
| 08 May 2016 12:04 PM |
Can't you just do :
local part = game.Workspace.Part local otherPartCFrame = script.Parent.CFrame part.CFrame = otherPartCFrame-Vector3.new(1,1,1)
~~~Da siggy is OP~~~ |
|
|
| Report Abuse |
|
|
|
| 08 May 2016 12:08 PM |
local part = game.Workspace.Part local otherPartRotation = script.Parent.CFrame.lookVector part.CFrame = CFrame.new(part.Position) * CFrame.Angles(otherPartRotation)
~~~Da siggy is OP~~~ |
|
|
| Report Abuse |
|
|
|
| 08 May 2016 12:09 PM |
| @Rock yup...I overcomplicated things ;( |
|
|
| Report Abuse |
|
|
|
| 08 May 2016 12:10 PM |
Or,
local part = game.Workspace.Part local otherPartRotation = script.Parent.CFrame.lookVector part.CFrame = CFrame.new(part.Position) * CFrame.Angles(math.rad(otherPartRotation.X),math.rad(otherPartRotation.Y),math.rad(otherPartRotation.Z))
~~~Da siggy is OP~~~
~~~Da siggy is OP~~~ |
|
|
| Report Abuse |
|
|
|
| 08 May 2016 12:11 PM |
Ye, it's fine Extreme. I think my last script will work Lord_Oscar, try that.
~~~Da siggy is OP~~~ |
|
|
| Report Abuse |
|
|
|
| 08 May 2016 12:13 PM |
I actually figured out a completely different work around that works better. Thanks though!
It's simple physics |
|
|
| Report Abuse |
|
|
KapKing47
|
  |
| Joined: 09 Sep 2012 |
| Total Posts: 5522 |
|
|
| 08 May 2016 12:17 PM |
local dir = Vector3.new(0, 1, 0) --Assuming it's the top of the part, if not change the axes local cf = CFrame.new(Part.CFrame, partToLookAt.CFrame * (dir + (partToLookAt.Size * dir) / 2) Part.CFrame = cf
Something like that. |
|
|
| Report Abuse |
|
|