Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Positioning a model within a part?

Hi. I do not want any code, I just want a little explanation to the question.

Let's say, I want to spawn a tree within the position of a part (like this: https://www.uploads.practicalhost.xyz/ecw3uwob.png)

The tree is supposed to be within the position of the part (I'm not a native english speaker, forgive my horrible explanations.)

So it would be within this position (as an example) https://www.uploads.practicalhost.xyz/rdlrfxnc.png and I want it within the position.

How would I do it? I have been thinking of this for about 2 hours now, not really found any way to do it correctly.

Thank you! ~ K2H74EliAX67UWXlH8bN

1 answer

If you mean within a random position of the part, you would take the CFrame of the tree and use a math.random() function to determine where it would spawn. You would also use the world position of part that is the parent of the tree as parameters for the maximum and minimum range of spawning.

It's difficult to fully understand what you are trying to achieve but I hope this helps.

This discussion is preserved as it was. New answers, comments, and votes are closed.