Only Close and Open Doors if needed

For me its seems a bit add not to check if door are closed or opened already and just calling a function to set rotation of door. How we basically don’t change that rotation angle by setting same angle over and over again its not doing anything wrong but still its not a way I would prefer to code stuff, especially if later we wont to animate this. So here is how I did at end, I think its not complex and its still reads perfectly well:

Also we already have DeltaTime available there so no need to call for any system time get functions I guess :slight_smile: . and DoorClosed variable is set in DoorOpen and DoorClose functions to match new door status.

Privacy & Terms