- Home /
Cannot make a world edge
I have created 4 cubes on the edge of the terrain, making each cube the right length of the terrain to create a world border but when my character controller tries to walk into the cube it walks straight through and off the terrain, does anyone have any scripts/ tips on how to fix this?
Answer by Piflik · Dec 23, 2012 at 12:14 AM
Don't move your character using transform.Translate() (or transform.position). This ignores collision.
It would be great when you add that when he uses the CharacterController component that he has to move it with it's $$anonymous$$ove of Simple$$anonymous$$ove function ;)
I'm a bit rusty on how to use unity so how do i check both those things? thanks
i don't have either transform.Translate() or transform.position in my character controller
The movement script would be very helpful in this case, otherwise these are all blind guesses.
Answer by sparkzbarca · Dec 22, 2012 at 10:58 PM
cubes need colliders. Select the box then on top go to component-> physics -> box collider.
Assuming of course your using the default character which has a rigidbody etc so it can collide.
the controller has a rigidbody and the cubes all have box colliders
If he uses a CharacterController he doesn't need a Rigidbody. The CharacterController is a replacement for a rigidbody which is not affected by the physics system. The CC uses it's own collixion detection. However this works only when you use the $$anonymous$$ove or Simple$$anonymous$$ove function to move it. Also a CC, unlike a Rigidbody, can only collide with it's own capsule.
Answer by Zbyl · Dec 23, 2012 at 12:03 AM
Maybe the player and the boxes are in layers that don't collide? See: http://docs.unity3d.com/Documentation/Components/LayerBasedCollision.html
Maybe your character controller travels too fast? Has too thick or too thin "skin"? Maybe the boxes are too thin?
In a hope to make things easier, im using the default first person controller
ive made the boxes x: 100 and my character controller can still walk through it and they are on the same layer
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Generating Meshes Is Slow 1 Answer
cube based enging 1 Answer
Collision with specific object... 2 Answers
Box collider doesnt detect collision 0 Answers