#AI Line of Sight
1 messages · Page 1 of 1 (latest)
Get pos of the AI and subtract it by the pos of the local player, this makes a raycast point from the AI to the Player at ALL times
(Note if it doesn’t work, swap the subtracted pos with each other, I honestly forget which is first but you’ll find it by playing with the math a little bit)
Is the raycast unsynced and how would I add limits to how wide the LOS is?
Or if that’s not possible with a raycast what other method would I use?
Raycast is local, and Raycast specifically is a line, it isn’t a cone, you can adjust the distance it can travel, but not the width, you’d want to use a sphere cast for that, it’s the exact same as a Raycast but it’s a rounded off cylinder instead of a line
I’m confused how would the spherecast widen and how would I stop it from going 360
Sry if it’s a dumb question but I don’t use raycasts and spherecasts much
@graceful wharf
it would never go 360 unless you specify it to?
It has a start pos and a direction to face
So it starts somewhere, and then points where you make it point
Yes but how would it widen over distance than?
It doesn’t, it’s a consistent size, it isn’t a cone, we don’t have a raycast that is a cone
Fairly sure you can make your own with some Vector math, but I’m unsure how you’d do that unfortunately
Oh dang
Do you know anyone that’s good at vector math?
I don’t know anyone really lol, you could search for it inside the #1020094893458198578 threads, I’m more than sure there have been others who have asked for a method to make a conecast
Ok
@dense loom (sry for ping I can’t delete this message if you don’t like pings) do you know anyway to make AI Line of sight like a cone line of sight?
i havent tried to make anything cone shaped so no
Ok
U should search for your question b4 asking
Pretty sure this has been asked b4 bc I’ve answered it b4
But to answer ur question, you use the Vector3 Dot chip in combination with the Raycast system Truchhi explained
How would I combinate it like what do o connect
Acos(Vector3 Dot(AI Forward Direction, Direction Of Player)), where Direction Of Player is the direction of the player from the AI, which is Subtract(Player Position, AI Position)
Check if this value is less than or equal to ur desired angle using the Less Or Equal chip. If it is, and the Raycast from the AI to the player is uninterrupted, the player is in the line of sight.
Could you tell me what ports to connect possibly I don’t get what you mean or what to connect to what
@pallid glacier
Might have to make a reference post on circuit notation bc it takes a while to have to explain the individual ports to connect (I know bc in the past I explained everything in this level of detail)
But until then wait for someone else to assist u
Do you think you could connect it in game or is that too much
Unless I just decide to explain it anyways but idk
I haven’t opened that trashcan 🗑️ of a game in so long bro 💀
I won’t be able to join u in game
Oh, I’m so confused why are you in disc helping with cv2 then
I’m hoping one day rec room gets better, tho im kinda tired of waiting
😔
ONE DAY
Dang
Do you know the post where you explained it?
One day bro 😔
All we can do is wait
Yep
I can search for it, but I likely put it in this style of explanation too
I’ll look
Detailed explanation by JustALittleKiwi: https://discord.com/channels/193073071802941451/1160710174298865674
Cryptic being toxic 💀 (the usual): https://discord.com/channels/193073071802941451/1150546295245779024
Me waffling: https://discord.com/channels/193073071802941451/1132078272545558690
THANK YOU SO MUCH!
You can mark this post as answered by selecting the "three dots icon" (···), selecting "Edit Tags", and enabling the "
Answered" checkbox.
oh they changed it to "✅ Answered"
chat should i stay og or switch to the new meta?
Who like mods changed it idk but just curious
ye i think they changed it when they merged circuits help into creation help
anyways mark as answered
Oh
Is it the name on mobile bc I don’t see the three dots 🧑🦯
Vector Doot
#1217612834108735618 message