stride icon indicating copy to clipboard operation
stride copied to clipboard

Not Adding Physics Shape To The Character Causes Unhandled Exception

Open ghost opened this issue 5 years ago • 4 comments

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

  1. add a characterComponent to an entity
  2. create a new script and add it to that entity
  3. in the script create a characterComponent variable then reference it through either game studio or code
  4. call any function for that characterComponent such as SetVelocity
  5. 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

ghost avatar Jun 14 '20 15:06 ghost

Hello, I would like to give this bug a try, any guidance? Thank you

r00terAF18 avatar Jul 21 '21 06:07 r00terAF18

@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.

tebjan avatar Jul 21 '21 09:07 tebjan

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!

dloe avatar Aug 12 '24 16:08 dloe

Yep, it's free, please do !

Eideren avatar Aug 12 '24 16:08 Eideren