My Challenge Design

Here is my design attempt:

create a new c++ class, inheriting from statichmesh again, but called UTankTurret, inherit from * StaticMeshComponent:

  • in BP, replace Turret with this new class, reattach static mesh and socket, move it in correct place (and probably do same with TankBarrel which will now have a new turret to attach to?)
  • allow this new class to rotate the turret with a Rotate method
  • use a UPROPERTY with a max rotation speed

in TankAimingController:

  • call the new tankturret:rotate with the yaw speed and direction
  • complication seems to be which direction to ask the turret to rotate in

I’ve probably missed a heap of work, let’s see…

Also need to expose a SetTurret method on TankAimingComponent so that the BP can set the turret for use in C++ (aiming function needs this to rotate the turret) and of course use that function within BP to pass the actual turret we are using

Privacy & Terms