- Home /
Can I prevent player through terrain when terrain height is modified at runtime?
Hi
I'm modifying the terrain programmatically by raising it 0.1m per second at any point my character controller is standing, and as expected, it falls through. I've been looking at the CharacterMotor script to look for a place I can modify it to accommodate the change, but I'm not having any success. Ideally the character controller should rise with the terrain, like it would with a platform. Can anyone suggest a way to achieve this?
Thanks
Answer by Celofa · Jan 12, 2011 at 01:49 PM
When u adjust the y-axis for the terrain, u could also adjust the y-axis of the character!!
If the terrain's y-axis gets increased via script, so increase the y-axis of your character!!
Or am i undesrtanding u wrong?
Thanks, that simple workaround should work in this case. I should have thought of that :) I'd still be interested to know if there's a way of making the character controller script cope with changes in terrain automatically.
Your answer
Follow this Question
Related Questions
Kinect issue with Character Movement while in flight 0 Answers
Click to Move problem with hills 3 Answers
C# Jumping Issue 1 Answer
Character Controller Jittering 0 Answers
Terrain help :c 1 Answer