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

how do you make your own parent to child relationship?

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

1 comment

0

Note: im NOT trying to make a True sound property into animationTrack object

1 answer

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

3 comments

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

0

its more of my lazyness that makes me want to find easier ways to do things

0

i never thought about parenting it to animation track and i will be sure to do it now

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