#Looking

1 messages · Page 1 of 1 (latest)

halcyon tangle
#

Alright so for some reason I was following a tutorial and he did the section where you can look around. I thought he was doing it with a mouse, but he made the looking buttons, A and D. I need some help changing this code up, and some of my other code.

#

Its hard to explain

south fern
#

If the controls already work, theoretically you can just replace the movement vector with the mouse axis stuff

halcyon tangle
#

Do I do that in the code, or the Input System?

south fern
#

Oh if it’s the input system, I have no idea then

halcyon tangle
#

Wait, he didn't put the looking in the input system, he just coded it like that.

delicate wedge
#

Where do you handle controls? It doesn't appear to be in that snip?

delicate wedge
#

Yeh but I don't see where you are referencing it?

delicate wedge
#

Tbh I've been on the new input system for a while. Can you just directly access the 2D by referencing it with "currentMovement"?

halcyon tangle
#

idk following a tutorial

delicate wedge
#

I don't know if I am missing something but where do you set "isMovementPressed"?

halcyon tangle
halcyon tangle
south fern
#

I’m only familiar with the old input manager… but you just have to figure out how to get a vector2 from the mouse axis. And then it’s an easy swap of the two vectors

delicate wedge
#

I don't know your type of game... Do you want it to move with mouse movement or move depending on where the mouse is pointing?

Example FPS where you rotate mouse
or overhead where you look at the point the mouse is at?

halcyon tangle
#

FPS

#

First person

#

Yes

delicate wedge
#

Alright 1 second, I'll try to write something with the new controller

#

Man I haven't actually done FPS mouse movement...

#

I think you can get the position like this
Vector2 mousePosition = Mouse.current.position.ReadValue();
And I guess you can use that to determine where the mouse has moved? And then maybe reset the position to Vector2.zero if it allows it?