Ok so I have some floating robots that shoot lasers out of there eyes, the lasers are continous while its attacking. I wanted the lasers to hit the player exactly where he was and not really go through him, but I didn’t want them to just automatically hit him, I wanted them to be kind of slower so he could dodge them. The way I did this was to make a laser with two bones in blender and just use Vector3.Slerp to move the last bone to the players position, but slower so the player can dodge it, and I used Quaternion.Slerp instead of LookAt so I could have it turn slower, but it keeps like spazzing out. This is the code I’m using, laserObject being the last bone. Help???
Two things. First; You should be using Lerp, not Slerp in your laser object. Slerp is a spherical interpretation and you want a linear interpretation given that you are only going from one place to another. Second; Why are you lerping/slerping to the player? A laser should not change direction.
Create a new script and attach it to the generated laser. This script should move the laser (bullet) at a constant velocity in one direction. This would let your player avoid it. (if it always lerped to him, he could never avoid it)
See the way I was doing it is its not a laser projectile, its a constant laser that the enemy shoots out. So the end follows the players position, but slower so the player has a chance to move out of the way, it was working fine with one enemy but when I duplicated it and put more than one on scene they started spazzing out.