|
| 16 Nov 2014 06:56 PM |
So, I recently discovered that you can place objects a certain space away from a Position (Vector3 value).
For example, if you wanted to place a brick on your characters head, as a function, you would do
a = Instance.new("Part", game.Workspace) a.Position = game.Workspace.YOURNAMEHERE.Head.Position + Vector3.new(0,1,0)
But the question is, is there any other way to do something like this without adding a Vector3 value to the head position? |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 16 Nov 2014 07:04 PM |
Well you could do: local pos = game.Workspace.YOURNAMEHERE.Head.Position
a = Instance.new("Part", game.Workspace) a.Position = Vector3.new(pos.X, pos.Y + 1, posZ);
But why don't you want to add a Vector3? |
|
|
| Report Abuse |
|
|
|
| 16 Nov 2014 07:07 PM |
@cnt
No reason. Just wondering if there were any alternatives.
I actually discovered the Vector3 adding all by myself. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 16 Nov 2014 07:08 PM |
Thank metatables for that. You should also look up multiplying a V3 by a constant. Adding a V3 to a CF Multiplying a V3 to a CF Multiplying a CF to a CF
(CF meaning CFrame and V3 meaning Vector3) |
|
|
| Report Abuse |
|
|
|
| 16 Nov 2014 07:10 PM |
@cnt
Ok, but I won't do too much work with CFrames. I'm still new to lua. |
|
|
| Report Abuse |
|
|
|
| 16 Nov 2014 07:11 PM |
I understand that CFrames and what not use tables, but if so, why doesn't Roblox add a "Type" property to it?
print(Part.Position.Type) -->Vector3
It would be so much easier than using pcalls to check type. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 16 Nov 2014 07:12 PM |
| Well I mean usually you wouldn't need the type, but I guess it would be useful. |
|
|
| Report Abuse |
|
|