First person point and click camera movement problem.

Hello Everyone!
I was tinkering with a point-and-click game and wanted the camera to follow the cursor. Here’s how I did it:

(I also set “show mouse cursor” , “Enable click events” and “enable mouse over events” to true and set the input mode to game and ui)

Additionally, I have a setup where I teleport the player to a specific part of the map, and in some cases, I need to rotate it so that it is facing the right direction. That’s why I need to be able to rotate the player.

I guess the style I’m aiming for is similar to Fnaf Sister Location. In that game, the camera sort of tracks the mouse cursor, but not too closely. It allows you to pan the camera around while still clicking on things.

It’s running smoothly, but I’ve hit a snag: I can’t seem to rotate the player. Regardless of the rotation of the player character, the camera always faces the same direction. Any ideas on how to maintain this movement style while allowing the player to rotate? Thank you in advance!
Here’s also a video demonstrating the current method I’m using and the problem:

1 Like

Get rid of the player start, or configure it to run from camera location?

Thanks for the reply! Unfortunately, that doesn’t work. It’s still facing the same direction. Additionally, I have a setup where I teleport the player to a specific part of the map, and in some cases, I need to rotate it so that it is facing the right direction. That’s why I need to be able to rotate the player.

Oh wait, I think it’s just your code on tick. It makes the player face world X.

Why not just use the first person character, it already does this?

I need my cursor to be visible because I’m using it to interact with things on the map(That’s why I set the “mouse over events” and “Enable click events” to true . If I use the first person input I have to click and drag on the screen. i need the camera to automatically follow the cursor.

Just put any widget on the screen with something in the centre. It is always in line with the camera :slight_smile:

I have a dot in my widget ( hud ), it’s always in the right place ( size exaggerated )

dot2

I’m having trouble putting it into words, but I really want the cursor to stay visible in my game. It just gives me better accuracy when clicking on things. I thought about using a widget and interacting with things that way, but it doesn’t really vibe with the style of game I’m going for. I guess the style I’m aiming for is similar to Fnaf Sister Location. In that game, the camera sort of tracks the mouse cursor, but not too closely. It allows you to pan the camera around while clicking on things. Thanks for the sugestion.

1 Like

This video will better show why exactly I want to use the cursor. I have specific places where I want to click in order to move around. It’s much better to move the cursor around than having to point to the middle of the screen on things:

Ok, it looks pretty evolved :slight_smile:

I think all you need, is to be able to turn that off while you rotate the character by 90, and then turn it on again. Then ‘get control rotation’ would go here

image

Would that for you, or do you want to be able to turn < 90?

1 Like

I already tried that but as soon as I reactivate it the camera suddenly rotates back. I think the problem is the way I get the location of the cursor.

I Figured out how to fix the problem. So basically I was using the backward vector as the start for the look at rotation. That’s why it was always facing the same direction. To fix that I created a variable and set it as the default to the backwards vector than when I’m rotating the player for exampe to the right I just have to set the variable as the vector right. If I want to face the oposit direction I just set the varaiable to the forward vector. Thanks for the help anyways!

1 Like

I think I may have something slicker, but I keep getting asked to do other things… :slight_smile:

You can turn freely with this, but it also brings the mouse back to center

mouse

At the moment you’re not using delta time in the interp, which means it does nothing basically. Also, I’m using actor rotation here, but that would be control rotation for you.

1 Like

Thanks a lot man! Your solution is much better!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.