My Character Runs into the Skybox.How do I make my Skybox Large and further Away

About Monkey 2 Forums Monkey 2 Programming Help My Character Runs into the Skybox.How do I make my Skybox Large and further Away

Tagged: 

This topic contains 2 replies, has 2 voices, and was last updated by  En929 4 months, 2 weeks ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #15868

    En929
    Participant

    I was trying to make a 3D game and my character keeps running into the Skybox (or maybe Cubemap or blue background) in front of him when the game starts. I barely hold the keys down for long and it does that. Such could be seen in the pictures below. Thus, I was wondering how do I make the Skybox bigger and further away so that the character won’t run into the Skybox as easily. What do I add to my code? My code and picture is below.

    Thanks

    (By the way, the game below was made based off of the “ninja.monkey2” example. I started with that example and only switched the character and added controls to it so that it could move forward and backwards. But, I didn’t actually put the background there. It is what came with ninja.monkey2 example)

    Pic 1: This is before my character moves

    This is before my character moves

    Pic 2: This is after my character moves just a little bit. It runs into the Skybox/Cubemap/or blue background in front of it.

    What do I add to the code below to fix this.

     

     

    #15869

    Ethernaut
    Participant

    Seems like you’re hitting the camera far clipping plane. Try setting _camera.Far to a much higher value, like 1000 or 10000.

    While you’re at it, you may want to check your model’s scale. Ideally, you should keep 1 unit = 1 meter. Some apps like Maya seem to default to 1 unit = 1cm, which makes everything 100 times larger than it should and causes all sorts of precision issues in large scenes (not just in games, even in pre-rendered stuff like feature films).

    Cheers.

    #15871

    En929
    Participant

    Thanks Ethernaut! That worked. And thanks the advice about the model scale too.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.