Spectate player at center of screen#1611
Spectate player at center of screen#1611AdamTadeusz wants to merge 2 commits intoNeotokyoRebuild:masterfrom
Conversation
|
One issue I've found using this so far is that it's difficult to know exactly who is closest to the center of the screen without a crosshair |
|
Now I'm wondering if it would be better to workout the player closest to the center client side and have a command sent to the server to spectate a specific player instead, that way there wouldn't be any issues with prediction and you could also use this for binds to spectate specific players without looking at them |
|
I can test this out later today. I do have a suggestion, though not sure how much of a lift it is on your end. Would it be better to draw a camera icon or the players name above their head when they are the one closest to the clients screen center? |
Agiel
left a comment
There was a problem hiding this comment.
What's the status of this PR? I think it's fine to merge as is. If we want more explicit feedback before switching to the new target we can add that later.
| Vector vecToTarget = pPlayer->WorldSpaceCenter() - pNeoPlayer->EyePosition(); | ||
| vecToTarget.NormalizeInPlace(); | ||
| float dotProduct = DotProduct(vecForward, vecToTarget); | ||
| if (dotProduct > targetDotProduct && dotProduct > 0) |
There was a problem hiding this comment.
dotProduct > 0 seems a bit generous here. Maybe do 0.5 for a 60º cone?
Description
A command that will set the observer target to the closest valid observer target to the center of a spectator's screen