Not Adding Physics Shape To The Character Causes Unhandled Exception
Release Type: Official Release
Version: Version 4.0
Platform(s): All
Describe the bug if you don't add a physics shape to the character component and call any physics function for that character you'll get the following error : Unhandled Exception: System.InvalidOperationException: Attempted to call a Physics function that is avaliable only when the Entity has been already added to the Scene.
To Reproduce
- add a characterComponent to an entity
- create a new script and add it to that entity
- in the script create a characterComponent variable then reference it through either game studio or code
- call any function for that characterComponent such as SetVelocity
- try running the game and you'll get an error
Expected behavior have a clear error that says "character doesn't have physics shape" or something similar
Hello, I would like to give this bug a try, any guidance? Thank you
@r00terAF18 hello, thanks for having a look at this, very nice to hear. i think the first step would be to reproduce the bug with visual studio attached and break at the exception.
then have a look in the debugger whether the error case could be handled earlier, e.g. inside the CharacterComponent class. for example, by checking whether a physics shape exists.
Hello! I was looking and I wasn't sure if this issue was being worked on. If not, I would love to give it a try, Thanks!
Yep, it's free, please do !