Update 18 - Teleport


Teleport

Finally, it works!

I tried first teleporting the ship but had some problems (I tried setting the position in the normal process-function, but I need to do it in a specific physics function - I learned that later) and wanted to be smart: Instead of the player, I can just offset the whole universe (except the player). This worked very well (especially since the background + nebula was not offset, so the jump was not noticeable) - at least for static objects. The idea was: I make a node "universe" which gets offset if necessary and all objects are a child of this node - except the player.

But: Rigid bodies created many problems (because they need to be offset in a specific physics function). For example: Asteroids were visible BUT didn't react anymore to impacts etc. Trash pieces surrounding earth were working (and reacting) but they changed their trajectory. Interesting: I didn't see problems with the mines + enemies...
As soon as I solved the issues (by forcing a position offset in the physics routine) I noticed that the bodies (e.g. asteroids) worked BUT all effects (impact, destruction) were not correct anymore because they had offsets ... not exactly sure why. I got the impacts running by adding them to a vfx-node which was NOT a child to the universe-node, but then the explosion- & damage-effect didn't work...no idea why.

Anyway, at the end I went back teleporting the ship instead of everything else! This works well now and the only thing I need to do is a better camera transition and maybe a post fx "teleport" effect to hide the jump.



Get Cozy Space Survivors

Leave a comment

Log in with itch.io to leave a comment.