|
| 05 Mar 2016 07:34 PM |
Hello, im trying to use a script to launch several blocks in opposite directions. I have a box, and I am trying to make the walls of the box all launch out in separate directions no matter how the box is turned.
Im currently using Velocity to launch the walls, but am not sure how to make the launch in the directions they need to go.
Any help is appreciated. |
|
|
| Report Abuse |
|
|
| |
|
|
| 05 Mar 2016 09:58 PM |
Use Wall.CFrame.lookVector when you change the velocities.
http://wiki.roblox.com/index.php?title=CFrame#Properties |
|
|
| Report Abuse |
|
|
|
| 05 Mar 2016 10:02 PM |
Im really bad at this, I dont understand what the line of code would be even after looking at the wiki page.
Wall.CFrame.lookVector = CFrame.new()? |
|
|
| Report Abuse |
|
|
|
| 05 Mar 2016 10:07 PM |
Assuming the direction you want them flying is the direction they're facing, you can try:
local Box = workspace.Box
for _,Wall in pairs(Box:children()) do Wall.Velocity = Wall.CFrame.lookVector*100 end |
|
|
| Report Abuse |
|
|
|
| 05 Mar 2016 10:11 PM |
| Thanks I understand it now, I will come up with something. That code just throws the whole room |
|
|
| Report Abuse |
|
|