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 4 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