Jump to content

Newton crash on switching level


Recommended Posts

  • 3 weeks later...

Is this using a callback or script to change the map inside the collision hook? This would definitely produce a crash. For stuff like this, it's best to set a global variable and then handle that in your main loop.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Check out some of the posts below this to get more detail Aggror: http://www.leadwerks.com/werkspace/files/file/430-next-level/

 

I don't agree with the global idea but the idea Josh is trying to say is that you can't change levels when inside the engines World::Update() method, which is the case inside a callback since World::Update() is actually calling that callback. You can set some flags and such inside this, and then change it at the start of your game loop. Again, I would avoid globals personally as there is for sure a better way to handle map switching but to each their own.

Link to comment
Share on other sites

The hook only sets a global bool to true. The level loading itself is done within a class. I am not using any lua to load levels.

 

After replacing the collision hook (which triggered a next level loading outside the hook) with a simple distance checker, I still get this error. So right now I don't have any collision hooks. smile.png

Link to comment
Share on other sites

I found the cause of this. Old bodies that were scheduled for deletion were hanging around causing errors. This was a mistake in my threading implementation.

  • Upvote 2

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...