Announcement

Collapse
No announcement yet.

Problem spawning pickup after throwing a rock

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Problem spawning pickup after throwing a rock

    Hello,

    I've created an weapon with which you throw a rock, that rock does damage depending on how long you charge it (it relates to velocity).

    When it's velocity is lower than 10 units it is supposed to make an ammopickup to replace it and then destroy itself. So far I managed to make everything.

    The main problem is that when it's too close to a wall or in a corner it sometimes doesnt spawns. I know it's because of collision detection, but I don't know where to find this collision detection with the world(which event?). My second question is if there is a function which checks if there is an empty space at an certain location(something like checkLoc(Vector)).

    The way I see it I have two solutions:
    - Rewrite the collision event and try to find a save spot to let the stone spawn in.(may lead to buggy graphics)
    - Make the pickup "float" in space, just let the rock stick halfway in the wall(not a problem since it will be a rocky terrain in which i'll be using the stone) i've tried doing this, but my rocks always fall through the floor :S

    I hope someone can help me with this.

    #2
    Why do you need to spawn a new actor? You could code ammo-pickup like behavior into the existing actor to give ammo to whoever touches it.

    Comment


      #3
      Hi,

      Thanks for the short but amazingly helpfull reply I'm wondering why I haven't thought of that. Thanks again!

      Comment

      Working...
      X