playMaker

Author Topic: Player can enter walls if scale is expanded. Help!  (Read 1991 times)

GrandAlchemist

  • Playmaker Newbie
  • *
  • Posts: 9
Player can enter walls if scale is expanded. Help!
« on: March 09, 2014, 08:48:47 PM »
Hey guys!

I want my player to be able to grow/get bigger for power-up.

When I scale the player it can go through walls/colliders after it expands - the capsule enters the wall, and the collider is ignored (meaning the player can freely walk through the wall)

How do I "push" the player outside of the collider when I make the radius bigger?

Alternatively, is there any way to make sure the player cannot go through the wall in the first place?

Thanks!
« Last Edit: March 31, 2014, 04:57:55 AM by GrandAlchemist »

redikann

  • Full Member
  • ***
  • Posts: 174
Re: Change size of character controller radius and wall clipping.
« Reply #1 on: March 10, 2014, 08:32:55 AM »
I believe I read in the Unity documentation that if you change your collider settings then Unity has to recreate the collider and that wont happen in an update call. You might want to check that.

GrandAlchemist

  • Playmaker Newbie
  • *
  • Posts: 9
Re: Change size of character controller radius and wall clipping.
« Reply #2 on: March 27, 2014, 03:35:32 AM »
Could raycasts be used to detect if the player is "in" a wall collider, then set the player position outside the wall collider?

Same thing with the ground... Is it possible to raycast downwards if the player falls through floor/terrain, and set player position above ground?

I am not very familiar with raycasting but would this be a suitable approach?? Thanks!

GrandAlchemist

  • Playmaker Newbie
  • *
  • Posts: 9
Re: Player can enter walls if controller radius is expanded. Help!
« Reply #3 on: March 31, 2014, 04:57:28 AM »
Still having troubles with this -

I had some success making the skin width of the character controller larger, but means that the character doesn't have good contact with ground/objects (makes it all floaty)