menu
Roblox Forum Archive
Home
User Search
Forums
Donate
search
settings
Home
User Search
Forums
Donate
launch
Go to User Dashboard
Forums
Scripting Helpers
How do I use lookVector?
chevron_left
chevron_left
chevron_left
of
1
chevron_right
chevron_right
chevron_right
How do I use lookVector?
Akartas
Join Date: 2009-07-08
Post Count: 2771
#45504241
Wednesday, April 13, 2011 6:34 AM GMT
I want to place an object 5 studs in front of an object, how would I do so?
Go to point in time
arrow_right
10 minutes before
5 minutes before
At time of posting
5 minutes after
10 minutes after
more_horiz
MrKazz
Join Date: 2011-04-10
Post Count: 1212
#45504287
Wednesday, April 13, 2011 6:43 AM GMT
I would not use lookVector at all I do not remember which axis is the front, so I will just post which one I think, you can change it to the other if you wish. Part.CFrame = Part2.CFrame * CFrame.new(0, 0, 5)
Go to point in time
arrow_right
10 minutes before
5 minutes before
At time of posting
5 minutes after
10 minutes after
more_horiz
Akartas
Join Date: 2009-07-08
Post Count: 2771
#45504324
Wednesday, April 13, 2011 6:51 AM GMT
Thanks!
Go to point in time
arrow_right
10 minutes before
5 minutes before
At time of posting
5 minutes after
10 minutes after
more_horiz
Robert00001
Join Date: 2010-05-15
Post Count: 7965
#45506118
Wednesday, April 13, 2011 10:32 AM GMT
@Sehnsucht, Depends if the brick is rotated, So you could use lookVector Part.CFrame = Part.CFrame + (Part.CFrame.lookVector*5)
Go to point in time
arrow_right
10 minutes before
5 minutes before
At time of posting
5 minutes after
10 minutes after
more_horiz
Akartas
Join Date: 2009-07-08
Post Count: 2771
#45511137
Wednesday, April 13, 2011 3:23 PM GMT
Ah alright, thank you Robert.
Go to point in time
arrow_right
10 minutes before
5 minutes before
At time of posting
5 minutes after
10 minutes after
more_horiz
oysi93
Join Date: 2008-04-27
Post Count: 12469
#45511184
Wednesday, April 13, 2011 3:26 PM GMT
@Robert No. CFrame takes rotation into consideration. A CFrame is a position along with a rotation, you see. Btw, front is negative z axis.
Go to point in time
arrow_right
10 minutes before
5 minutes before
At time of posting
5 minutes after
10 minutes after
more_horiz
chevron_left
chevron_left
chevron_left
of
1
chevron_right
chevron_right
chevron_right