- Home /
Question by
YutDevGames · May 17, 2021 at 02:12 PM ·
airts
how to make AI move to target positions
I am making a RTS game, I know how to make the mouse select military units, but i don't know how to make the AI move to a the mouse position with Vector3.MoveTo(transform.position, Vector3 targetposition)
Comment
Answer by visca_c · May 22, 2021 at 04:33 AM
Camera.ScreenToWorldPoint() with mouse position should be what you are looking for. https://docs.unity3d.com/ScriptReference/Camera.ScreenToWorldPoint.html
Your answer
Follow this Question
Related Questions
RTS game - AI help 0 Answers
RTS Grid and Pathfinding 2 Answers
How do i have AI objects have teams and attack when in range 3 Answers