UID Help

0 favourites
  • 7 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • Hey its me again :x

    I got the following problem:

    I have 1 Object "Bat", the Bat is Created Random every 1 - 5 seconds and moves left toward my player,

    My player shoots the bats with shuriken and destroys them.

    What i want to do: When you shoot a bat, theres a random chance this bat Drops an item, but how do i do that? Thought about using UID's but then i would have to know which bat got hit..

    Tried the following: "Shuriken on Collision with Bat"-> "Bat Spawn another Object Item on Bat.X Bat.Y" "Bat.Destroy, Shuriken.Destroy" but that doesnt work :/ it creates the Item somewhere in the screen, but not at the position of the bat..

    p.s.: its important that the bat drops the item and not the shuriken, because i got particle weapons as well, which would look strange

    edit: tried with pick nearest bat from shuriken, but same problem like above: creating item somewhere on the layout

  • I think the image point, that is the origin of the bat is too far away from the bat drawing itself, thus the "it spawns somewhere else" problem.

  • Why do you use Bat.X and Bat.Y on the "spawn another object" action?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • If I understand this is what you wanna do?

    2 objects collision then spawn another in the same position?

    mega.co.nz

  • Shuriken> On collision with bat

    Destroy bat

    Destroy Shuriken

    Bat > On destroyed

    Spawn another object

    This way, when the shuriken hits, it destroys both, and then whenever a bat is destroyed it spawns an object.

  • Thanks for all of your replies:

    fassflash: on start of layout i destroy the bat, thus the problem is solved , and anyway the bat was outside the layout positioned so i would not be able to see where that item spawns.

    Bat.X and Bat.Y because the shuriken which collides with the bat gives the bat a .this function (in java) and spawns on destroyed bat an item.. didnt work, but hey,

    I FIXED IT ..

    so:

    1. Every Second set Randomdrop to random(2)

    2.Shuriken -> on collision with bat AND randomdrop = 1 -->> spawn item at bat.imagepointx and bat.imagepointy

    3. Shuriken on collision with bat , -> bat destroy, shuriken destroy,

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)