3rd person top-down - look to mouse not working

River

New member
Dear Sirs,

I've started a new unity project and reimported the UCC, Behavior Designer (+ movement pack) + the DeathmatchKit.

So far so good. I have a scene setup for 3rd person top-down with a player character and with the following settings:
Camera Controller - view type 3rd person top down: Vertical look direction - enabled.
Player character - Unity Input: Disable Cursor - disabled
Ultimate Character Locomotion - 3rd Person Top Down: Look in move direction - disabled.

I was expecting this to cause the player to look at the mouse position, sadly it does not, it stares only in one direction (the direction of the camera).

When I enable Look in move direction the player simply looks in the move direction (so that at least works, but is not the behavior I want)

In my old project using the previous UCC release this all worked fine.

As an aside (perhaps this can give a clue?: when I play the UCC demo the mouse cursor moves extremely fast as to be barely unplayable. In any case when I reach the roof and go into 3rd person top down mode Nolan does look at the mouse position.

Well, any tips would be helpful - because I'm stumped.

Thanks!
 
Looking at the cursor does seem to work in the demo scene using those settings - are you fully locking the cursor using Cursor.lockState = CursorLockMode.Locked? If so, the cursor will technically remain in the center of the screen, so that could be why the character's not looking where you expect it to. If so, an alternative would be to instead hide the cursor with Cursor.visible = false, and you can restrict the cursor's position to stay within the game window with Cursor.lockState = CursorLockMode.Confined.
 
Dear Andrew,

To get this off my chest I was so put off with this issue I tried some other controllers out there, but still none seems so promissing as the UCC...if I could get it to work properly.

As mentioned the issue occurs with the settings mentioned, and did not occur when I previously installed UCC in the some month earlier - this is what bugs me the most. That being said I am resolved to fix this issue. So you mention 'are you fully locking the cursor using Cursor.lockState = CursorLockMode.Locked?''

Not that I am aware as I did not change any setting other then the above. However, it's good to check - where should I check this (i.e. is it a field on one of the components or in one of the scripts.)

Thanks for bearing with me.
 
Just to mention this as well, I my previous installation (which still does effectively look at the mouse) I had the problem that for the teleport ability (following the video to the letter) the teleport targetting prefab was unable to find the ground floor (only was visible on the rim of certain objects) - Could this be related? Also in that case I had simply installed the UCC and was going through the videos to set up the weapons and abilties - all worked fine but for the teleport that did not find the ground (in the end I solved it by making a new targeting script myself). But still very strange as in the video it worked out of the box... Just throwing it in here would these be somehow related.
 
So I have attached a debug script to check if the cursor is locked:

I can confirm it is set to 'None' (at Awake, Start, Update and at LateUpdate).

To again cofirm:
(Unity Input): Disable Cursor is unchecked.
(Camera Controller): View Type = Third Person Top Down - Vertical Look Direction is enabled.
(Ultimate Character Controller, move type Top Down): Look in Move Direction is unchecked. / Head = ORG-head (Transform)

So what else can be suggested to check?

Summarizing the bugs (already seen in the previous install, where odly the look to mouse did work right out of the box - could this be helpful as possibly reletaing to the same underlying issue):
- could not get ground targetting for the Teleport using the magic item script - magic - Direction - selected 'indicate' with the surface indicator prefab
- When setting-up new weapons, the crosshairs remain fixed on the player and do not move with the mouse.

Since all seem related to mouse-based positioning. These appear too coincidental to be unrelated to some underlying issue.

I really would appreciate help on this. - If this/these issued can be fixed I will give a 5-star rating if not merely for the excellent Support.

Thanks.
 
Update - I set-up a new scene based on 3rd person with Third Person Pseudo 3d - character can look at mouse position. Doing the same again with the 3rd person Top-down it doesn't - what's is going on here? - :)-)
 
Update - I set-up a new scene based on 3rd person with Third Person Pseudo 3d - character can look at mouse position. Doing the same again with the 3rd person Top-down it doesn't - what's is going on here? - :)-)
Sorry, i think this may be my oversight. Assuming you have item abilties setup, if you set the aim item ability to automatic (so the character is always aiming) or if you press the aim button does it then track the mouse as expected? I am afk until monday, so I am afraid i cannot look at the script, but iirc it is checking on the aim state and perhaps i forgot to add a catch for specific setup you have. It should only be a small tweak in the viewtype, but if you can confirm the above, please?
 
I followed your suggestion - indeed when making an assault weapon and setting the aim to be automatic then yes the character succesfully trakcs the mouse position. If it is not set to automatic than the player does not track the mouse position.

As an aside: I was also checking whether setting the automatic aiming also solves one of the other issues while I was at it: even though tracking with aim set to automatic succesfully makes the player track the mouse position, UI crosshairs still remain fixed on the nolan character (the corsshairs do not move with the mouse position).

Thanks for your response!
 
Not that I am aware as I did not change any setting other then the above. However, it's good to check - where should I check this (i.e. is it a field on one of the components or in one of the scripts.)
If you have the cursor disabled then the Unity Input component will do this for you. If you have the cursor enabled then it will not lock the cursor and you'll need to create a new script which does it.

With that said, are you able to reproduce the problem in the demo scene? This will give us a better idea of the cause.
 
Hi Justin

Amazing I get replies on a Sunday (was not at all expecting this).

To recap:
The cursor is not locked and this I checked at runtime (See one of my replies above).

As mentioned when in the Demo-scene when I walk into the 'top-down' zone (on the roof) the player succesfully tracks the mouse (e.g. looking towards). I am not sure where to even start to reproduce the problem in the demo scene, since I do not know what is causing it.

In any event, to reproduce the problem it would be a simple matter I suppose of starting up a fresh scene with 3rd party top-down and configuring a new character with the Nolan model (also set to third-person top-down), leaving all else to default. Then setting the following:
(Unity Input): Disable Cursor is unchecked.
(Camera Controller): View Type = Third Person Top Down - Vertical Look Direction is enabled.

I stress I have not done/changed anything else. What one should expect is the player to track the mouse position, but it does not. It only does so when a new weapon is added and the Item abilities (on the Ultimate Character Locomotion script) is set to Aim 'Start Type'= automatic.

This situation occured when I started up a new Unity project and installed UCC fresh. I did so since I have the behavior designer (and move pack) - I wanted to test also the behaviors from the Deathmach kit and thought it best to make a fresh project for this to explore.

I note that in my old project in which UCC was also installed (about a month ago) I did the same set-up and then the player did succesfully track the mouse position from the get go.

So it may be an UCC update thing or (possibly more likely) - could well be that I am missing something very simple or making a stupid rookie mistake (but I don't understand what).

Hope this helps (somewhat), Cheers.
 
Thank you - I was able to reproduce that. The reason it works in the demo scene is because the character is always aiming. The problem relates to some of the improvements made in version 2.4 for top down. To fix this you can change line 362 within TopDown.cs from:

Code:
if (!m_Aiming) {
to:
Code:
if (!m_Aiming && !m_PlayerInput.IsCursorVisible()) {
This fix will also be in the next version going out this week.
 
Last edited:
Thank you - I was able to reproduce that. The reason it works in the demo scene is because the character is always aiming. The problem relates to some of the improvements made in version 2.4 for top down. To fix this you can change line 362 within TopDown.cs from:

Code:
if (!m_Aiming) {
to:
Code:
if (!m_Aiming && !m_PlayerInput.IsCursorVisible()) {
This fix will also be in the next version going out this week.
Hi Justin,

Cool that works! - I was starting to doubt myself for a while there...

For the other two issues remaining:
- could not get ground targetting for the Teleport using the magic item script - magic - Direction - selected 'indicate' with the surface indicator prefab - I will check this again to understand if this is now also solved.
- When setting-up new weapons, the crosshairs remain fixed on the player and do not move with the mouse. - I'll work on this. If you happen to have a nice script (getter and setters for this this would be helpful)

In any case, as promissed I will post a review on Unity today giving a 5-star rating commenting on the excellent customer support!
 
Thanks for the review and I'm glad that it worked! There will be a cleaned up version of TopDown in the next update.

- could not get ground targetting for the Teleport using the magic item script - magic - Direction - selected 'indicate' with the surface indicator prefab - I will check this again to understand if this is now also solved.
If you can follow up in the other thread that would be great!

- When setting-up new weapons, the crosshairs remain fixed on the player and do not move with the mouse. - I'll work on this. If you happen to have a nice script (getter and setters for this this would be helpful)
The CrosshairsMonitor does not have the option of moving with the cursor so I have always disabled it in a top down view. For now your new script could move the crosshairs GameObject to the mouse position but I can also add this to my to do list.
 
Thanks - as suggested by Justin I'll close off this thread and continue on the previous one concerning this.
 
Top