Stride Forums Archive

Run time Error when physics is added to a procedural model

3 posts, 1252 views, 2015-05-25 to 2015-05-26

jamoreno (Jose Andres Moreno Ruiz) 2015-05-25 #1

[Game]: Error: Unexpected exception. SiliconStudio.Core.ServiceNotFoundException: Service [IPhysicsSystem] not found …

Demo proyects Works fine. But when I want to recreate it by my own then I get that error when physics is added.
Where is the problema?

xenux 2015-05-26 #2

Physic System is an optional module of Paradox. If you want to use it, you need to add it explicitly from the code:

        //physics needs explicit initialization
        GameSystems.Add(new Bullet2PhysicsSystem(Services));

Note that in future it will be possible select optional modules from the Game Studio directly.

jamoreno (Jose Andres Moreno Ruiz) 2015-05-26 #3

Here it is what you have to do exactly (in the source code from Visual Studio).

public class MyGame : Game
{
protected override void Initialize()
{
base.Initialize();

        //physics needs explicit initialization
        GameSystems.Add(new Bullet2PhysicsSystem(Services));
    }
}