Hello, I’m currently creating a tower defense game, and I’m having issues making my tower rigs look at the enemies they’re attacking. I’m currently using CFrame.lookAt() to make the towers look in the general direction of enemies, without accounting for the Y-axis to prevent the legs from also tilting upward/downward. However, with enemies that are particularly large, or float high up in the air, this just looks very strange, and it doesn’t give the effect that the tower is “aiming” at the enemy at all. The game Tower Defense Simulator has a realistic approach to this issue, making the arms and head of the tower rigs orient up/down toward enemies, shown below:
I’ve tried several approaches to try to get this effect to work in my own game, such as setting the C0 of the neck & shoulder joints in the direction of the enemies, but I cannot find a method that works as intended.
Any feedback would be greatly appreciated, thanks!
Well, you can see how in many shooting games, the arms point where the mouse is (they move up and down. Now to make your npc point at a part, make the arms and head point up and down (you can get code from a kit on the toolbox that makes the player’s arms move to where the mouse is, and just apply it to your npc), then make the whole character rotate left and right, this should give an accurate pointing system, its what many turrets use in real life.