-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sync fire extinguishers FX #1884
base: master
Are you sure you want to change the base?
Sync fire extinguishers FX #1884
Conversation
cebc7b6
to
386f080
Compare
Needs rebase since #1878 is merged |
I'll probably look a bit more into it concerning the fire extinguisher's rotation |
d3c1491
to
a88dff2
Compare
a88dff2
to
92b1b00
Compare
…ffect rotation according to where the player is really aiming
… extinguisher's target detection
using NitroxModel.DataStructures.Util; | ||
using NitroxModel.Helper; | ||
using NitroxModel.Packets; | ||
using System; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong sorting
public static bool Prefix(FireExtinguisher __instance) | ||
{ | ||
// Only for remote players' fire extinguishers | ||
if (__instance.transform.TryGetComponentInAscendance(12, out RemotePlayerIdentifier identifier)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason one is 12 and the other 2?
using NitroxClient.Unity.Helper; | ||
using NitroxModel.DataStructures; | ||
using NitroxModel.Helper; | ||
using System.Reflection; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong sorting
@@ -0,0 +1,17 @@ | |||
using NitroxModel.DataStructures; | |||
using System; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong sorting
using NitroxClient.GameLogic.PlayerLogic; | ||
using NitroxModel.DataStructures; | ||
using NitroxModel.Packets; | ||
using System.Collections.Generic; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong sorting
// Equivalent of UpdateTarget but with references to the remote player | ||
fireExtinguisher.fireTarget = null; | ||
Vector3 vector = default; | ||
GameObject gameObject = null; | ||
|
||
TraceRemotePlayerTargetPosition(identifier.transform.position, playerRotation, identifier.gameObject, 8f, ref gameObject, ref vector, true); | ||
if (gameObject) | ||
{ | ||
Fire componentInHierarchy = UWE.Utils.GetComponentInHierarchy<Fire>(gameObject); | ||
if (componentInHierarchy) | ||
{ | ||
fireExtinguisher.fireTarget = componentInHierarchy; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this needed for vfx and sound?
Will wait for a movement fix PR to be merged before continuing this one |
Only issue is player rotation. On the local player, we are able to turn around as much as we want and spray the fire extinguisher everywhere. But remote players don't have this rotation thing. They can only rotate to the lower side (a little angle is possible only). So we'll always see the extinguisher facing downwards.
EDIT: The fix is to only rotate the FX
And this branch is built on #1878https://youtu.be/LyenVi8g9fk
To be reviewed and looked at after #2012