generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: LookVector

Previous Thread :: Next Thread 
mark298 is not online. mark298
Joined: 24 Oct 2008
Total Posts: 1264
19 Nov 2013 10:33 AM
Is there any way to change the LookVector of a part?

I'm testing a few thing and I'm trying to spawn a brick and make it face the same way as another one, but it won't work.

e.g.

Part1.CFrame.lookVector = CFrame.new(Part2.CFrame.lookVector)

The error I get is that I cannot assign a LookVector.

I'm still quite an intermediate scripter so help is appreciated.
Report Abuse
Scriptural is not online. Scriptural
Joined: 06 Sep 2013
Total Posts: 2979
19 Nov 2013 10:35 AM
CFrame and CFrame.Angles
Report Abuse
breuning is not online. breuning
Joined: 30 Oct 2008
Total Posts: 4268
19 Nov 2013 10:37 AM
change the rotation.

for example:


lv1 = Part1.CFrame.lookVector


lv2 = (Part1.CFrame * CFrame.Angles(math.pi/2,0,0)).lookVector

if lv1 == lv2 then
print("wat")
else
print("i was rite")
end
Report Abuse
mark298 is not online. mark298
Joined: 24 Oct 2008
Total Posts: 1264
19 Nov 2013 10:40 AM
I'm not sure how to do it that way though.

I tried:

repeat
wait()
Part1.CFrame = CFrame.new(Part2.Position + Vector3.new(0, 1, 0) * CFrame.Angles(0, 1, 0)
until Part1.CFrame.lookVector == Part2.CFrame.lookVector

As I said, still quite new to scripting.

Report Abuse
mark298 is not online. mark298
Joined: 24 Oct 2008
Total Posts: 1264
19 Nov 2013 10:41 AM
Posted that last thing before I saw breuning's.
Report Abuse
breuning is not online. breuning
Joined: 30 Oct 2008
Total Posts: 4268
19 Nov 2013 10:42 AM
easiest way to make Part1's lookVector Part2's lookVector:

Part1.CFrame = Part2.CFrame
Report Abuse
mark298 is not online. mark298
Joined: 24 Oct 2008
Total Posts: 1264
19 Nov 2013 10:45 AM
Wow, I feel so stupid... XD
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image