IronWarrior / SuperCharacterController

Unity custom character controller
MIT License
753 stars 207 forks source link

Player sticking to walls #42

Open timminkov opened 6 years ago

timminkov commented 6 years ago

If you brush up against a wall in the demo scenes, the character "sticks" to the walls and needs quite a bit of force to be pulled off. This is especially an issue if you're falling from heights and accidentally hit a wall.

Is this by design?

FullstackJack commented 6 years ago

All scenes? Which scene specifically? The walls in the test area scene are part of the ground mesh, perhaps it's an issue specifically mesh colliders.

FullstackJack commented 6 years ago

Create a box mesh and see if that still causes issues. I'm using boxes for invisible walls and those seem to work fine.

timminkov commented 6 years ago

It's the main test scene (with all the different colored geometry). I can't use boxes unfortunately as I've created a mountain-y terrain in blender. Need to use a mesh collider.

timminkov commented 6 years ago

In addition, I sometimes fall through the ground. It can happen often at corners with large slope differences.

timminkov commented 6 years ago

Also - The pushback seems to bug out at extreme angles and push my character continuously upwards.

FullstackJack commented 6 years ago

Does your scene have a TempCast layer? Add that layer per the instructions in the PDF documentation. I didn't know it needed one at first and I was having all sorts of weird collision errors including player falling through and player jutter when going up ramps. It took a few hours of trial and error, but now a capsule with player scripts seems to traverse my high poly terrain just fine. If you have steep terrain, perhaps your mesh is not a high enough resolution. Experiment with high and low poly terrain. You can export your height map, change resolution of mesh and reimport heightmap.

FullstackJack commented 6 years ago

My terrain is 100 x 100 and 40 high. 1025 map.

timminkov commented 6 years ago

Darn, I already have the TempCast layer added. Here's an image of what the actual model/ground looks like: image

timminkov commented 6 years ago

Having tons of issues with falling through the floor at high velocities too. Tried changing to using a fixed timestep, but setting it to 60 brings the game to a crawl.

timminkov commented 6 years ago

I was able to solve some of the falling through floors issues with this https://github.com/IronWarrior/SuperCharacterController/pull/23. That being said, it's still buggy.

FullstackJack commented 6 years ago

Not to be a traitor and there is no denying SCC is an awesome project; however, with the number of critical bugs (fall throughs, wall stickiness, etc.) I'm beginning to wonder if it's really production-ready or just a POC teaching tool. Have you tried Invector's Third Person Controller on the Asset Store? They have a lite version which is free and provides basic locomotion and humanoid animation setup as well as improved camera controls including close to camera object fade. I'm considering using that since they have paid add-ons which implies they are dedicated to fixing bugs and the basic demo is much more impressive. Also, considering pairing that with Forge Networking Remastered for multiplayer gameplay since some developers have had success marrying the two and it seems like a positive alternative to Unity Multiplayer.

timminkov commented 6 years ago

I tried Invector's TPC but it felt a bit too "realistic" for my needs. I was looking for something arcade-y (banjo/dk64). I think in the future I'll just tweak Unity's built in character controller for my needs.