How do I fire automatically

0 favourites
From the Asset Store
Full game Construct 2 and Construct 3 to post on Google Play
  • okay so im making a tower defence game and want the missile to shoot at the enemy when in range. ive tried line of sight ect but no deal. tried turret it just looks at the enemy and when using line of sight, move towards enemy it does nothing. Please help

  • also, when trying to get the turret to face me when firing i am having issus, it seems to turn round and fire out the side of it. REALLY ANNOYING

  • Firstly detect that LOS is working and they are indeed seeing each other, you can set up so the object is destroyed to confirm this. If they are not seeing each other, be aware that the LOS has a cone of view which may not be pointing towards the other object and so they are not in the detection area. With the turret just looking at the enemy and not moving at all you may be triggering events once only instead of constantly checking so look into this. Take a look at the tutorial level for turrets to see how they are set up.

  • thanks for the reply. so i tweaked it a little but the player is just watching the enemy and not moving towards it.

    ibb.co/mezbeQ

  • OBLIVION

    "Player Move in front Pig" changes z-order! It has nothing to do with aiming/rotation/movement.

    You really should start with reading some tutorials.

  • OMG im such an idiot. i didnt realize this. so how do i get the object to move towards another upon line of sight

  • basically i want a tower to shoot a projectile upon seeing the enemy moving towards it. i need this basic setup in order to continue my project

  • That's why I said to look at the turret tutorial level provided, all the logic is there for turrets detecting the player and then aiming and shooting at it. To get an object to move towards another object position you can use the Pathfinding behaviour to set destination to an object, find path and move along path to it.

  • thank you. however when i have setup turret behaviour to lock on to a target rather than my turret looking directly at it, it seems to want to fire from a side angle rather than face me directly. why is this?

  • What is the fire logic? Shoot bullet from turret? If this is the case it will shoot from the origin of the object, which could've been moved. If you haven't set up the angle of the bullet it will just fire at its own angle instead of towards the player position. Many things could be wrong, easy to work out with a shared capx.

  • You have another game (that shooter from "Animation bug" post) where you have your turrets (enemies) turning towards player and shooting. Why don't you just do the same in your new game?

  • the issue i am having is that rather than the enemy looking directly at me then firing it seems to spin past that point and fire from its side. i need it to face directly so when im setting up my towers they will will from the front when enemy is in LOS

  • Just turn your turret image. Not the sprite on the layout, but the image in the sprite itself. Gun should be pointed to the right.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • i will give that a try. also. another animation issue. can you explain why this is happening?

    so you click on the grey box and a turret will appear and then in range it will fire at the enemy. the enemy dies and the explosion begins but after that it goes all pissed. it doesn't disappear instead goes all over

    https://drive.google.com/file/d/0B_wGtoNKF4qgaTZNQ3B0eFFlS3M/view?usp=sharing

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