![]() SpawnedTree.Parent = workspace - Add to workspace Local SpawnedTree = treeToSpawn:Clone() - Clone Tree Local randomInt = math.random(1, #children) ![]() If #children = 1 then - If there is only one model, select '1' "No trees found! They need to be in ReplicatedStorage/Trees") If #children = 0 then - If 'Trees' folder exist, check if there is tree models Local children = storage.Trees:GetChildren() "No 'Trees' folder found! Create this folder in ReplicatedStorage and place trees there!") If not storage:FindFirstChild("Trees") then - Just check if 'Trees' folder exist Local storage = game:GetService("ReplicatedStorage") - Obvious Local randomInt - Number of model to pick Local treeToSpawn = nil - Final Tree Model to spawn Local NO_TREES_FOLDER_FOUND_ERROR = "No 'Trees' folder found!" Local rotation = CFrame.Angles(math.rad(0), math.rad(0), math.rad(0))ĪND! I use a tree model named Pine Tree - Pivot is in right place, Orientation and Position is set to (0, 0, 0)Įntire script (not localscript) located in workspace without GUI code: local NO_TREES_FOUND_ERROR = "No trees found!" Set the CFrame Angles to 0, 90 or 180 etc (I checked all axis) but trees are still not rotated in up direction.The problem seems to be that the trees are not positioned straight - in the video I showed, the trees do not clone straight (up) even on Flat Terrain. I have written a Plugin script that randomly selects a tree model from 'ReplicatedStorage/Trees', then clones it and places it at the click point in the 3D world (in Roblox Studio Editor, not in game). ![]() Apart from that I know Java, Kotlin and C# reasonably well. I would like to write in advance that I wanted to describe my problem on the Roblox Developers site but unfortunately I can't post new topics there yet as I am a new Roblox Studio user with very little experience in Unity 3D.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |