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

how do you make your own parent to child relationship?

Asked by 3 years ago
Edited 3 years ago

im trying to make things more organize by making sound something like a property of the animationTrack even if it isnt

i will need sound to be a child of animationTrack to do that

i already got the animationTrack done and i have a script that automatically loads all the tracks in and put every single track into a table

now im just working on a prototype to find a way to make sound a child of animation

this is what i came up with for prototype which didnt work because either it printed out nil and animation or the table itself(table: 0x4c0c11c7bc45873e) and sound

local Table = {


    Animation = "Animation" and {
        Sound = "Sound"
                }

}

print(Table.Animation)
print(Table.Animation.Sound)

i dont really know what im doing wrong here

i want to achieve something similar to down below where i can reference Sound like a property

AnimationTrack.Animation.Sound
AnimationTrack.Animation
0
Note: im NOT trying to make a True sound property into animationTrack object proROBLOXkiller5 112 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

You can't make Sound a property and you can make it a child. Why not just parent Sound to AnimationTrack?

local sound = workspace.Sound --write where you located your sound
local animation = workspace.Animation --same goes to here

sound.Parent = animation
0
i didnt wanna reference every single sound so i think to myself if i could just type Animation.Sound:Play() then i wont even have to reference the sounds proROBLOXkiller5 112 — 3y
0
its more of my lazyness that makes me want to find easier ways to do things proROBLOXkiller5 112 — 3y
0
i never thought about parenting it to animation track and i will be sure to do it now proROBLOXkiller5 112 — 3y
Ad

Answer this question