Hello, guys!
I’ll be very thankful for help in making top-down controller like in “Metrocide” game.
I attached the link on the short video and hope anybody know how to make the same controller ![]()
Please, help!
Hello, guys!
I’ll be very thankful for help in making top-down controller like in “Metrocide” game.
I attached the link on the short video and hope anybody know how to make the same controller ![]()
Please, help!
Are you using a console controller or a mouse for this?
Hi, I’m using mouse
Hi there,
this shouldn’t be complicated at all;
Your player moves in plane… you don’t need to even raycast to floor,
you could just have a imaginary plane.
Unity already has a Plane class, that you can raycast against;
Create a plane object… not plane geo, but in code (Plane groundPlane).
Then you can raycast againts it:
if (groundPlane.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), out hit))
{
// do heading stuff
}
You can decide your “heading” i.e. where you nose is pointing, by building a direction vector (pos B - pos A).
Using this vector you, you can make your transform look at that direction… but you don’t want to make it’s forward this direction… as you would most likely point your nose up or down.
I hope this made sense and I didn’t make an error, it’s bit too late here already… there might be other ways to do this, but this just came to my mind.