#3D Isometric - Rotate "player" to cursor position

1 messages · Page 1 of 1 (latest)

wide cosmos
#

Hello, I'm having trouble to get cursor world position and deal with the rotation (quaternion) to rotate my player to cursor position (3D Isometric).
I would appreciate some help 🙏
Thanks you

polar cape
#

Are you able to get the position of the mouse with relation to the world space yet (assuming you click on the terrain, or something)?

wide cosmos
#

I just started a project to learn about Unity and DOTS

polar cape
#

That will be the first step. Inside a System (ECS) you will need to use a ray from Camera to mouse position to get the worldspace point you want your player to rotate towards. Once you have that point, the rest of the work is rotating the transform of your player to face towards the direction of the worldspace point from your mouse click.

#

Oh, welcome! Have you gone through all the tutorials for DOTS yet?

wide cosmos
#

Hum ok, I'll try to dig more in this way !

#

Well actually I'm new in Unity, and even more in DOTS/ECS, but I'm learning by reading/testing stuff

polar cape
wide cosmos
#

This is what I did actually

polar cape
#

a few videos there, it will help you answer part of your question especially around rotating your character.

wide cosmos
#

Well it looks messy, because it's just a "test" project to learn about dots

#

everything is made with entities

polar cape
#

very cool actually!

wide cosmos
#

Well, my final goal is to make a vampire survivor like but in 3D

#

and with a lot more enemies

#

and why not cooperation

#

That's why I'm going with DOTS, to be able to manage a lot of entities and still having good performance 🙂

polar cape
#

makes sense

wide cosmos
#

But yeah, I have to learn eveything, this is my first time in game dev 😄

polar cape
#

the first step is to do translate the mouse click into a world position that your player can face towards.

signal sky
#

I have an example repo with similiar functionality

#

turret has to aim at target position, which is cursor

wide cosmos
#

Okay, thanks you, I'll take a look tomorrow, bit tired for now 😄

#

thanks for help !

polar cape
#

is BustedBunny you, @signal sky ?

signal sky