Roblox Set Primary Part Cframe
Part2parent model set the primary part modelprimarypart part1 modelparent gameworkspace while true do local primarypartcframe.
Roblox set primary part cframe. In this tutorial i show you how to move a model using primary part which you can use this to move many parts inside a model. Which will be equal to nil if there is no primary part. Note this function will throw an error if no modelprimarypart exists for the model. It is made up of a positional component and a rotational component.
All other parts in the model will also be moved and will maintain their orientation and offset respective to the modelprimarypart. 15 things you never noticed in fortnite duration. Sets the basepartcframe of the model s modelprimarypart. To demonstrate setprimarypartcframe a simple loop is then run which switches the model between two cframes every second.
Partcframe cframenew5 0 0 cframeangles0 mathrad45 0 1 rotate the part 45 degrees around its y axis. How to script a moving part roblox scripting tutorial duration. 2 rotate the part 45 degrees around its y axis. Cframe short for coordinate frame is a data type that describes a 3d position and orientation.
Local cframe modelprimarypart and modelprimarypartcframe returns. Classes enums data types lua. The primarypart of this model is then set meaning modelsetprimarypartcframe can then be used. A canonical method of creating a cframe at a certain position and euler rotation xyz.
It includes essential arithmetic operations for working with 3d data on roblox. Make a smooth moving modelpartunit roblox studio duration.