[BUG] Top Down View + Projectiles

neubern

Member
Hello Justin,
I've found another Bug regarding Projectiles, this time related to the Third Person Top Down View, and somehow linked to the VirtualControls.

As long as a Client is using the VirtualControls, his Projectiles seem to be directed at the Ground.
The Master/Server always has his Projectiles fired correctly, but all the Clients shoot the Ground apparently.

You can reproduce this in the Demo Room by doing the following:
  1. Add the Virtual Controls to the UI
  2. Add the PUN Virtual Control to the Canvas
  3. Disable the "Demo Manager" Gameobject
    - Disabling the Demo Manager allows you to change the View Type of the Camera, otherwise the Viewtype will always be Combat
  4. In the "PunGame" GameObject, change the Spawn Mode to "Fixed Location"
    - Prevents an Error from popping up, as the SpawnGroup in the Demo Manager was deleted
  5. Set the Camera View Type to Top Down
  6. In the Nolan Prefab, Force the Input to Virtual
  7. It doesn't matter if the Nolan Prefab Locomotion is Set to Combat / TopDown. The Bug still happens,
 
I believe that your networked character should use the adventure movement type instead of top down. Top down expects a top down view type which you don't have on the network.
 
Hello Justin,
The Adventure Movement will not work.
I definitely need the TopDown View.

Any other View I try, will not work for the Project I'm working on. If the Camera is set to any other ViewType, all Characters shoot the Ground, when the Camera is facing the Character from upwards.
 
I've also tried using the Cinemachine Integration, but it doesn't work on the PUN Integration as there are too many Null Refs after adding it
 
There might be a problem with the PunLookSource, making ALL clients in a TopDownView to shoot the ground at a 90° Angle.
The Master is the ONLY who can shoot correctly. Just test it in the DemoRoom and you will understand.
 
Only the remote player should be set to adventure - your local player can still be top down. Most of the other movement types require the camera which remote players won't have.
 
I wasn't able to reproduce this exactly based on your steps but I did notice that the character was looking at the floor. I didn't have a problem with the projectile, even when both the local and remote players had a top down movement and view type.

To fix the character looking down I changed line 187 of PUNLookSource to:

Code:
var lookDirection = m_LookSource.LookDirection(true);

With this change the player looked in the correct direction on the client and also fired in the correct direction.

 
Top