top of page
Search

Arcade Flight Sim 2nd Post

  • Writer: Philip Apple
    Philip Apple
  • Nov 1, 2024
  • 2 min read

So all things have changed since last blog post. The main things I've add were weapons for my jet to shoot. This plane is nearly fully operational.



How My Missle Works

  • When the player presses the spacebar the BP first checks to see if you are locked onto a target if you are then it sends a message to the spawn manger to spawn a missile.

  • Once the message is received it is then bound to the event to CallSpawnMissle and also passes the target(which will explained later) and then calls Handle Shooting Missle

ree
  • Handle shooting missle once called it first check see if the player has special 1 selected(this has not been implemented yet) the flip flops between firing the left and right missile. It then valid gets the two missle and the target and fires the missle calling detach missle.

  • Call Detachmissle check to see if special 1 is selected valid gets missle reference and detach them from the player jet calls fire away and set ready to fire to false wait ten seconds and set it true again and reattachs the missile.

ree
  • Once the attached missle is called it is set to reference and the attached to player jet. It's called on begin play as well.

ree

How my missle works

  • On even begin play stop movement is called to prevent the missile from being launched prematurely

ree
  • If fireaway is called it first sets a target set delay so it doesn't immediately turn to the target and then set a target rotation from target at the missle location. it then sets an initial speed so Missle can finally fire and set velocity to it.

  • When a missile overlaps with an enemy it prevents the missile is overlapping with the player or with another missile and once a valid target is found applies damage and spawns an explosion and plays a sound then destroys the actor.

How my lock-on feature works

  • It simplified the explanation of how my lock on feature it works. On event begin play it get all targets with the tag "Target". On event tick if there targets Check the target distance. Get all targets within a certain distance of the player. Set them to the current actor. if a closet target is set it will mark closest target. If not mrk target will fire where all targets within the area add to the possible target. If the player press the lock-on feature the array will find the closest target. If not 0 it then checks to see if not a negative then sets the target and once the array is complete it set locked on to be true.

ree

To my spawn manger i also added clean feature that cleans up all wrecks in the world. I'm not showing how destroying a vehicle works because it rather basic an unnecessary.


 
 
 

Comments


bottom of page