Search code examples
c#unity-game-enginegame-physics

Unity 3D - Transforming beetween worlds/planes?


Let's say I want to replicate Planeshifting from Legacy of Kain: Soul Reaver in Unity.

There are 2 realms: Spectral realm and Material realm.

The Spectral realm is based on the Material realm, only has the geometry distorted and certain objects fade out/become non-interactive.

In Soul Reaver, it is used as means to go to areas where you normally wouldn't be able to in Material (distorting geometry), to use other powers (such as going through grates).

My question is: Is it even possible at all to implement this in Unity 3D? (I would need the Scene(level) or the objects to have 2 states somehow that I could switch beetween/distort to real-time.)


Solution

  • I would call this a rather advanced topic and there are multiple ways of accomplishing a at least similar effect.

    But to answer your actual question straight away - Yes it is possible.

    And here are some approaches i would take (i guess that would be your next question ;))

    • The easiest way is obviously having game object which have their collider and renderer disabled (or the whole object) when "changing realms". But this for sure isn't the best-looking way of doing it, even tho a lot of motion blur or other image effect could help.

      (Depending on what shaders you use, animating the alpha value can create a fading effect as well)

    • The more advanced way would be the actual manipulation of vertices (changing the object). There are quite a few tutorials on how to change the geometry of object. Take a look at Mesh() in the official documentation:
      http://docs.unity3d.com/ScriptReference/Mesh.html

      A class that allows creating or modifying meshes from scripts.

    • Another way (didn't try) thats rather easy would be using shape keys. I don't know which Software you use to create your world/models but blender has this function which allows you to define a base shape, then edit the verticies in blender and save it as a second (or more) shapes. Unity can blend smoothly between those shapes as being shown in this video:
      https://www.youtube.com/watch?v=6vvNV1VeXhk