Point & click movement and aiming.

millar5001

New member
Hey I am trying to create a point and click control scheme similar to the old Cannon Fodder style games where left click would set the destination for the units to travel to and right click would set the the target for the units to shoot at and has no effect on the movement of the agent other than the rotation.

I am using...
- Opsive Third Person Controller
- Behavior Designer + movement pack
- A* Pathfinding Project

I am using AI Agents because I will be controlling multiple units at the same time.

I have no problem making agents move to the desired location but what I am having trouble with is making the agents rotate towards the aim target whilst moving in a different direction.

I have achieved a way of doing it but it is very hacky where I disable "Enable Rotation" on the AIPath script that comes with A* Pathfinding when I press shoot and then I am able to set the rotation manually. When shoot button is released "Enable Rotation" is reenabled so that the agents face the same direction that they are walking.

It should be so simple but I am still new to third person controller so I am still trying to get my head around it. I presume I need to create an ability? I am not sure if I am going the right way about this so any input to point me (and my agents) in the right direction would be awesome.

Thanks
 
The character controller takes over the transforms so the Movement Pack is not able to set the transform directly. The proper way would be to create a new ability which modifies the rotation within UpdateRotation to face the target. I have it on my todo list to create this ability but I haven't been able to yet.
 
Top