Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Cylinder orientation on different surfaces?

Asked by 3 years ago
Edited 3 years ago

Hi, so I've been using the normal vector to align parts with different surfaces. Although I don't know how to make it work with cylinders. I need the flat part of the cylinder to face up.

Could anyone give me an idea on how to accomplish this?

Gif: http://gyazo.com/b4d9ab5566adbcb91b19e6aca1bba0e1

0
I'm not completely sure, but just from testing in studio it seems like cylinders always spawn with the flat ends facing the x axis. so, if you have the normal vector, just rotate the cylinder by 90 degrees along its z axis and offset using half its x size instead before you calculate the rest. also, neat gif! Speedmask 661 — 3y

Answer this question