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

Rotating multiple bricks of different orientation along a singular vector?

Asked by
Xetrax 85
6 years ago

Alright, I'll try to be short, not looking for a dead giveaway, just a direct place to look, with maybe some explanation on the side. I've created a tree generation script that makes wondrous trees that drop leaves, look amazing and all that jazz; since I've made a random wind simulation script, that stores a wind speed/direction as a unit vector and randomizes it throughout gametime, I want this script to actually interact with the trees, make each of the leaf bricks angle slightly in the direction of the wind, changing direction with the wind, think of a top, how the top wobbles when you spin it, I kindof want that wobble to the leaves so they "tilt" in the direction of the wind.. I just need a place to start, the parts that make the tree canopy are all randomly orientated so using Part.CFrame = Part.CFrame*CFrame.Angles(math.rad(15), 0, 0) doesnt make them all tilt in the same way, Im feeling like it has something to do with quaternions, just the wiki page has me confused on how exactly to use them effectively.

Lol, well that wasn't short at all.. Anyways, help will be greatly appreciated.

Regards, Xetrax

Answer this question