Advertisement

Need help: Make rts style move

Started by November 22, 2018 03:27 AM
1 comment, last by Zakwayda 6 years ago

Hi guys,

i need some help

till now 

i made almost perfect mouse selection unit 

i mean rts style c# mouse scrtips 

this works almost all of the warc3 game mouse function 

 

now i want to unit to move with navmesh

 

navmeshagent.SetDestinaton(Input.mouseposition) 

this doesn work T.T 

im so sorry guys i forgot if (Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), out hit, 100))

please help me! thanks!

I'm guessing you're using Unity. I'm not sure I fully understand your post, but this:


navmeshagent.SetDestinaton(Input.mouseposition) 

Looks suspicious. I assume you mean 'mousePosition' and not 'mouseposition'. If so, I think that's in screen coordinates. If so, it seems like some sort of transformation would be needed there (unless somehow the environment is in the same coordinate system as the screen).

Anyway, you might need to provide more info, such as a larger code sample. (You can copy and paste to avoid errors like the 'mouseposition' thing, and use the forum 'code' option for formatting.)

This topic is closed to new replies.

Advertisement