How do I stop the camera from going through the wall?

0 favourites
  • 2 posts
From the Asset Store
The ultimate voice pack filled with 1,536 files of .......wav and mp3 of individual numbers, letters, and words (that go
  • I've been playing with this thing for a while and the camera keeps going into the wall or behind a wall. I know this happens in a lot of 3D games, but it's driving me bonkers.

    Is there any MacGyver type trick? A hack, that I probably shouldn't do, but works. Like "when wall is behind Sprite, set invisible" (Which I tried, but couldn't get it to work. lol)

    Anyone?

    youtu.be/kH_wI_w8U8Q

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • A stupid method I have used is to pin a fan shaped sprite to the player billboard facing toward the camera. Your player billboard is already locked to the camera so if you pin the angle of the fan, it should do the same.

    Then you set any wall colliding with that fan to invisible. This has some obvious drawbacks, like allowing players to see through walls, but works well enough in many cases.

    Alternatively, you could use the Line of Sight behavior to cast a ray in the direction of the camera from the player, and then clamp the camera distance to the length of that ray if it intersects a solid object. That might have some issues to, just spitballing.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)