Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How does ROBLOXs anti-'view through walls' work?

Asked by
KoreanBBQ 301 Moderation Voter
8 years ago

Hey, So ya know how when you move your camera and theres a part in the way, it zooms in so the part is out of the FOV.

I'm making my own camera controls, it's basically a fixed camera looking from the top. Imagine you have a headband with a pole and a lateral stick and on the end theres a camera: thats what im doing.

In numbers, the camera is set to like your characters head's position+Vector3.new(0,25,20)

Id like to make it so that when you close to a wall and the position in which the camera is supposed to be is on the other side or inside the wall then the position is in the intersection of the line connecting your head and the normal pos with the wall.

I tried raycasting but the ray is colliding with itself, and I tried using Findpartonraywithignorelist but it still errors for no reason.

Any other way I could do that? As stated in the question I'd like to know how ROBLOX does it. Thanks

0
FindPartOnRay only hits *parts*, it doesn't hit "the ray itself". Rays aren't instances to hit. BlueTaslem 18071 — 8y
0
Forgot to mention I created a part on the ray KoreanBBQ 301 — 8y

Answer this question