For the augment the Zapper I had to create an effect that looked as if lightning was arcing between different players. This was troubling because of the speeds the lighting would have to travel. If it was a projectile moving towards an actor there would be an issue of it being Infront of the actor one frame and then behind the actor the next so collisions would never hit. After doing some research the common consensus was to simply take the projectile and just make it a ray cast instead. That wouldn't work. It was needed that there is an arcing between characters. A visual travel to the lightning.
Eventually I thought of using the dot product trick from one of our earlier classes. By normalizing the vectors then taking the dot product I could simply teleport the head of the bolt forward little by little every frame until it reached or passed the target. At this point it would deal damage and find the next target that fits its criteria. That being the closest target that is not dead and has not been hit by this bolt yet and that is not behind a wall. If those criteria are all met it will do the same thing heading towards the next target until it runs out of targets to hit or its target counter reaches zero. (The target counter is how many hits it has left until it deletes itself).
Kenny Phebus 5/12
Did you like this post? Tell us
Leave a comment
Log in with your itch.io account to leave a comment.