Download

Turret... non control... or how to put it.

Hey everyone, I have a question i’m not even sure how to ask.
I want to make a controllable vehicle where the player does not directly control the turret.
I am aiming at standard mmo targeting approach when it comes to the players controls.
But I want the player to mark a target, and then the turret to traverse on its own towards the targeted object. And you cannot fire until the turret is aimed somewhat in the general direction. As if someone else /ai controlled it…

Tips on where to start with this?

Simply interpolate between the two rotations (turret’s current rotation and the target) using RInterpTo, this will allow you to set the time it takes to look at the target once marked, once the desired rotation has been met you could toggle a boolean (i.e. can fire). During times where no target is marked you could give the impression the turret is still manned and scanning for enemies by picking a random rotation and interpolate between the current and random rotation…you could take it further still by randomising (within a range) the interpolation speed so it appears more human.