SmartlyDressedGames / Unturned-3.x-Community

Community portion of the Unturned-3.x repo. If you have access to the source code you can find it here:
https://github.com/SmartlyDressedGames/Unturned-3.x/
84 stars 18 forks source link

Rangefinder item type causes problems if asset's hierarchy isn't exactly the same as vanilla one #4384

Closed DerpyHoowes closed 1 month ago

DerpyHoowes commented 3 months ago

I've been trying to make my own rangefinder item, which won't have any model or light emitted, because I don't want it all on the type of gun Im making it for, so I couldn't use the vanilla one.

It seems that if the hierarchy isn't exactly matching the vanilla example, it causes numerous issues on a gun that it's attached to: Gun equip animation missing Gun's scope render plane missing Rangefinder UI still being present on screen after dequipping the item

Don't understand why it has to be so hardcoded, with all the visual elements such as lights being essential for the item to work, and causing so many issues if this condition isn't met.

https://github.com/SmartlyDressedGames/Unturned-3.x-Community/assets/59206749/12fb902a-7e66-481b-b924-9929891e5150

SDGNelson commented 3 months ago

It's probably throwing an exception expecting those gameobjects to exist. Before there were modded items for everything it wasn't a big deal to plan for everything being optional.