A simple (albeit slightly naive approach) may be to just use :SetPrimaryPartCFrame() on the enemy model. The following line connected to the RunService.RenderStep event would ensure the Enemy is always 10 studs in front of the player and looking at them too:
--assuming there is a variable `player` which the enemy should clamp to and look at
[EnemyModel]:SetPrimaryPartCFrame(CFrame.new(
player.Character.PrimaryPart.CFrame * Vector3.new(0,0,-10),
player.Character.PrimaryPart.Position
))
Better approaches might poll the offset from “in-front of the player” that the enemy currently is, and with some logic decide on an approach to get back to “in-front” (possible flipping over the player if the difference is extreme, while only shifting slightly if its close).
It may also be possible to construct a setup where orientation is always aligned, however default character physics would likely make this buggy, so a custom player controller may be necessary.
Connect to RunService’s Heartbeat event, in the event, simply use PivotTo like this:
local attackerCF = attacker:GetPivot() -- or you can use humanoidrootpart
target:PivotTo(attackerCF * CFrame.new(0, 0, -offset) * CFrame.Angles(0, math.pi, 0))
When you need to release the target, disconnect the event.
Thank you all for the help. But I have found a way of doing so. I have used Align Position and Orientation correctly this time. Hopefully it works well.