Jump to content

attached pivot with an noise.lua script saved as prefab don't play after loading by code


holschuh
 Share

Recommended Posts

Hi,

 

i have an model with an child pivot which have an noise.lua script (source sound) attached.

I save the model as prefab and when i load this by code the sound no longer plays.

If i attach the prefab to an map manually sound plays...

 

Is there an solution or workaround for.

 

self.enemy=Prefab:Load("Prefabs/cow2.pfb")

 

post-13671-0-41551200-1436081002_thumb.jpg

 

cu

Volker

Link to comment
Share on other sites

HI,

 

i workaround it by code making an pivot with the noise.lua script - save this also as prefab and load both and do setparent...

 

self.enemy=Prefab:Load("Prefabs/cow2.pfb")

self.step=Prefab:Load("Prefabs/cowsteps.pfb")

self.step:SetParent(self.enemy)

 

cu

Volker

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...