|
| 06 Dec 2015 11:38 PM |
How do I script a thing so that it is horizontal to the ground yet parallel to another object?
for example, a block is turned 45o and tilted 45o the object that would be in need of scripting would be a beam 5 studs below this block, turned 45 degrees but not tilted at all
i initially had this:
beam.Position = block.Position-Vector3.new(0,5,0) beam.Rotation = Vector3.new(0,block.Rotation.Y,0)
turns out roblox has weird angles so that the x and z axis affect the y axis to be different, causing the beam to turn to angles that are the reverse of what they should be |
|
|
| Report Abuse |
|
|
|
| 06 Dec 2015 11:42 PM |
CFrame my boy. CFrame. http://wiki.roblox.com/index.php?title=CFrame |
|
|
| Report Abuse |
|
|
|
| 06 Dec 2015 11:50 PM |
omygoodness i feel like such an idiot rn
i tried CFrame earlier but used improper math (accidentally added a negative) so the brick appeared out of place spent the last like 4 hours adding like if-then functions to ranges of angles to reposition all of the bricks but wow
anyways ill get back to you if i figure out it doesn't work thnx |
|
|
| Report Abuse |
|
|
| |
|
|
| 07 Dec 2015 01:12 AM |
Set a relative CFrame, as in CFrame:toWorldSpace() or CFrame:toObjectSpace() and work from there.
[Work not tested, not bested.] |
|
|
| Report Abuse |
|
|
|
| 07 Dec 2015 01:25 AM |
It seems like that has the same functionality as
part.CFrame = block.CFrame*CFrame.new(Vector3.new(0,-5,0))
aka it replicates the angle exactly, i want that except it to be horizontal setting the rotation doesn't help at all because roblox's x and z rotations majorly affect the y rotation for some reason |
|
|
| Report Abuse |
|
|
vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
| |
|
|
| 07 Dec 2015 03:11 AM |
>welds r u srs
>CFrame just discussed that in the posts above xP |
|
|
| Report Abuse |
|
|