#how do i detect if a player is looking at an object

25 messages · Page 1 of 1 (latest)

solar cosmos
#

Raycasts can save you

#

It casts a ray

#

and checks what it hits

#

and how far that hits

#

all you need is a starting position (Player position) and direction (Local Camera Forward or Player Forward Vector)

#

spherecast

#

same thing as raycast except it sends a lot of rays in a radius

brisk prairie
#

Help me backrooms pls

solar cosmos
brisk prairie
#

Why

solar cosmos
#

you come in someone else's help post to beg for help with your backrooms game

#

that's why

#

get out of here

brisk prairie
#

No

#

Help me

#

I need

solar cosmos
#

I don't care

#

make a post

brisk prairie
#

Need help make walls floor roof monsters weapons water system fortnite like battle pass military game xp system star wars resident evil game back rooms xp system entity doors roblox game who join me for helpig mi

#

Plz

sage pendant
#

I’d recommend using a vector dot method if u want to check if it’s in ur field of view. It’s much more efficient than a spherecast

solar cosmos
#

Because they're shit and that's what kids like to make.

sage pendant
#

If you’re asking about the vector3 dot method, then here’s an image that shows the setup. Keep in mind that I used variables for this setup, but they are not needed depending on how you’re incorporating this. I’m not gonna explain fully what the Vector3 Dot does, but just know that it’s checking how close you are to looking at an object here. The output ranges from -1 to 1 depending on how close u are to looking at the object.