Portal Stencil Behavior Test

Portal Behavior and Stecil Test for Unity Event

This shows the hole with the Default Shader Material applied

This shows the hole with the Default Shader Material applied

There are three states to this. The start is the main state that listens for everything. Close and open scale the portal and turn on / off FX

There are three states to this. The start is the main state that listens for everything. Close and open scale the portal and turn on / off FX

On trigger stay for bottom trigger code checks if pulling or blowing and if pulling then add object to tracking variable

On trigger stay for bottom trigger code checks if pulling or blowing and if pulling then add object to tracking variable

Then it takes the position of the object and the end point it needs to go to and subtracts them to get a vector of force to add to the object to move towards the hole. I adjust the force with some multiplication

Then it takes the position of the object and the end point it needs to go to and subtracts them to get a vector of force to add to the object to move towards the hole. I adjust the force with some multiplication

When objects hit top trigger inside hole, they store to a list, turn off physics and set to inactive. This is used later for dropping items out of portal.

When objects hit top trigger inside hole, they store to a list, turn off physics and set to inactive. This is used later for dropping items out of portal.

When boolean is true for "Down" variable then objects from list are loops through, physics turned back on and set to active to fall out of hole.

When boolean is true for "Down" variable then objects from list are loops through, physics turned back on and set to active to fall out of hole.

Portal Stencil Behavior Test

This started as a test to work with Unity's stencil buffer but I ended up having a lot of fun with it and turned it into a full blown behavior event.

Portal shader is made by setting 4 materials onto a stencil layer outside of the default one and layering the render order of them so that the sides of my hole are hidden but the hole and everything under it is visible.

See description in images below of Bolt code behavior