Ok guys lemme explain what I am trying to do...
I have a dude cutting wood right?
so that means that when tree is cut down some wood planks will fell on the floor...
=> this is a TOP DOWN game.
PROBLEM: I need to walk behind the trees and I also need to walk in front of them...
MY SOLUTION: I created a new object at the bottom of the tree. And now I check if player is overlapping the object... In case he is.. The tree will move to the layer below and if he isnt the player will move to the above layer.
That creates an effect that the player can walk behind and in front of the tree....
There is a problem however....
If I am behind the tree and walk down... I will cross trough the tree because there is no colider right?
So I added a collider... but now when my planks fell from the tree , they hit the collider wich stops them from falling on the floor.
HOW DO I SOLVE THIS??
Here is what I am doing... I added a new object on top of the collider that checks if the planks are overlapping it or not... In case they do are overlapping, I change the Y position of the plank to go below the collider , That creates an illusion that the plank is falling...
MY CONCERNS:
I would like to know if I am missing something because I think the way I did this is way too hacky...
Anyways looking forward for some response!!
Thanks!