the print will give the proper thing. the spawning works fine, no errors occur. self.engineSound becomes a pointer to that object. obviously change aemitter to the appropriate thing if you wanna use it

Sun Feb 04, 2018 1:17 am

Bad Boy

Joined: Fri Sep 10, 2010 1:48 amPosts: 661Location: Halifax, Canada

Re: spawning something and keeping track of it too (SOLVED: ez)

You probably shouldn't have to do that ToAEmitter there but whatever, CC's finicky so maybe you do.You should use local variables though, with lua if you don't use the local keyword (or put them in self or some other table) your variables will be declared in the global namespace which is kinda messy.

Tue Feb 06, 2018 7:19 am

Hoovytaurus

Joined: Mon Dec 21, 2015 9:30 amPosts: 82

Re: spawning something and keeping track of it too (SOLVED: ez)

Bad Boy wrote:

You probably shouldn't have to do that ToAEmitter there but whatever, CC's finicky so maybe you do.You should use local variables though, with lua if you don't use the local keyword (or put them in self or some other table) your variables will be declared in the global namespace which is kinda messy.

if just sfx = self.enginesound or the other way around then for some reason sfx becomes nil and cant be spawned or controlled it's weird

also yeah i ended up doing self.x on everything once it started having issues with multiple of the same gun

Who is online

Users browsing this forum: No registered users

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum