in0finite / SanAndreasUnity

Open source reimplementation of GTA San Andreas game engine in Unity
https://discord.gg/p6jjud5
MIT License
2.15k stars 353 forks source link

Replace Camera.current with Camera.main to prevent it from grabbing scene camera #19

Closed DannyWebbie closed 5 years ago

DannyWebbie commented 5 years ago

Camera.current can lead to infinite destroy -> spawn loop if you have scene view open.

in0finite commented 5 years ago

I didn't know that Camera.current can be a scene view camera.

What do you mean by infinite destroy ? What will be destroyed ?

DannyWebbie commented 5 years ago

Anything using that script expecting game view camera is affected, but in this case it was the player ped being destroyed. We probably shouldn't be adding that script to player controlled peds in the first place, but that's a story for another commit.

in0finite commented 5 years ago

Aha, I get it. Thanks.