FRotationMatrix
offers matrix construction using a series of ::Make*
routines. They are easy to use and useful to get one object to face another. Say you have two objects, one of which is following the other. We want the rotation of the follower to always be facing what it is following. The construction methods of FRotationMatrix
make this easy to do.
In the follower's
Tick()
method, look into the available constructors under theFRotationMatrix
class. Available are a bunch of constructors that will let you specify a rotation for an object (from stock position) by reorienting one or more of the X, Y, Z axes, named with theFRotationMatrix::Make*()
pattern.Assuming you have a default stock orientation for your actor (with Forward facing down the +X axis, and up facing up the +Z axis), find the vector from the follower to the...