Actor is supposed to spawn when the collision occurs...

snortch

  • Posts: 25
I can't figure out why the explosion actor wont spawn when the collision occurs?? This is the kind of thing  that’s easier to explain by showing so I made a screenvideo that explains whats supposed to happen.

Some might recognize that what I'm attempting to build is from the Richard Sneyd Udemy course. So far, I haven't been able to get answers from Richard so I thought I would try here.

Heres the video:

http://screencast.com/t/hGnalFNodR

would greatly appreciate any ideas.

Photon

  • Posts: 2691
I don't typically use "For each collision point", so I'm not sure what's happening exactly. Try putting a print statement into that loop and then checking the console to see how many times its runs/prints a message to the console.

However, I would think something like "Spawn at x of laser/y of laster" would work better, with slight positional modifications as you see fit.
Do NOT PM me your questions, because I likely will not respond. If I have replied to your question on the forum, keep using that topic. Thanks!

tgbtom

  • Posts: 127
I tend to run into problems when using the "create recycled actor of type" block. I'm not exactly sure how it works however I feel like trying to create an actor through this block that hasn't already been recycled would fail to create an actor. I would try changing that block to just the "create actor of type".

Hope this helps!

-Tgb
________________,.-*'Renewal'*-.,________________
http://community.stencyl.com/index.php/topic,10615.0.html

http://renewalthegame.blogspot.ca/
------------------------'*-.,Renewal,.-*'------------------------

snortch

  • Posts: 25
I don't typically use "For each collision point", so I'm not sure what's happening exactly. Try putting a print statement into that loop and then checking the console to see how many times its runs/prints a message to the console.

However, I would think something like "Spawn at x of laser/y of laster" would work better, with slight positional modifications as you see fit.

Thanks for the suggestion. I placed a print statement inside the "For each collision point" loop and it never prints to the console. I then placed the same print statement outside of the loop (above it) and was able to get the print statement to appear in the console each time a collision took place. This leaves me trying to figure out why the "For Each Collision Point" loop isn't working. I was thinking that maybe the Enemy actor somehow wasn't setup right (maybe its collision boundary??). I just dont understand why that loop doesnt work because a collision IS taking place as the print statement proves...

Screenshot of the blocks:

http://www.screencast.com/t/B7JLXpzzg

Any other hints?

snortch

  • Posts: 25
I tend to run into problems when using the "create recycled actor of type" block. I'm not exactly sure how it works however I feel like trying to create an actor through this block that hasn't already been recycled would fail to create an actor. I would try changing that block to just the "create actor of type".

Tgb - I also tried changing to a "Create" instead of create recycled but got the same result.

Thanks for the suggestion though. Really appreciate it.


tgbtom

  • Posts: 127
Does your actor have a circular collision? ;P Just thought I would put it out there, I don't think this block works if the collision is a circle. Besides that I'm not really sure, try to find a work around rather than using the "for each collision point" block.  What exactly is that block needed for anyways? You could make it create the explosion when they collide without that additional block.

If you need multiple explosions you can use a Random number within the actors size a few times and create the explosion at each random point?

-Tgb
________________,.-*'Renewal'*-.,________________
http://community.stencyl.com/index.php/topic,10615.0.html

http://renewalthegame.blogspot.ca/
------------------------'*-.,Renewal,.-*'------------------------

cloa513

  • Posts: 245
Just from viewing the game directly, the laser shots don't seem to be colliding with the enemies.  Try just kill enemies with one collision first. It could need active collision detection. 

snortch

  • Posts: 25
Just from viewing the game directly, the laser shots don't seem to be colliding with the enemies.  Try just kill enemies with one collision first. It could need active collision detection.

Yea, I thought that too, so I got rid of the blocks that kill the laser after 1 second, but still no dice. I also placed a print to console block to make sure that collisions were occurring and found that they were. I have a new a approach that the instructor (Richard) provided that I'm going to try now. I'll post back here and let you know what happens.

snortch

  • Posts: 25
Ok, with the Udemy instructor's help, I was able to get it working correctly. It looks like the key was to not use the "For Each Collision Point" block. Attachment shows what my blocks look like now:


Thanks everyone for your ideas.