so im trying to make a stealth game but how would i do this???
if you play the game entry point you know what i mean
example:
if you could link any tutorials that would be great
so im trying to make a stealth game but how would i do this???
if you play the game entry point you know what i mean
example:
if you could link any tutorials that would be great
I’m not a scripter in thr slightest, but maybe you could have a “beam” that directs towards the player. And when they are detected, the bar would build up. And if the beam is blocked by something like a part, it would start the cooldown of the bar.
Sorry if this doesn’t help.
alr ALOT and I mean ALOT goes into these ADVANCED NPCS alr first you prob have to work with the dot product you may also have to work with rays and magnitude I’m spit balling here btw
then for the bar thingy your prob goanna have to do some GUI math and you also will prob just make some timer I’m not the best scripter yet
but your goanna have to do alot you also will work with path finding if you can do all these topics with ease you can just make the NPCS
do you mind elaborating what dot product is?
It would probably need to use time, so taking the time that the said line is on a valid player, it will go up until its max is reached, whilst changing color, or going down if the line cannot be on the player.
One component would be to develop visibility and sound mechanics, and this is probably not the easiest thing to do. You could define maximum ratings for both, to determine how alert the NPC should be.
e.g: maximum scale on the visibility meter should enable the NPC to see you from much further away. This could possibly be implemented using either raycasting and different zones that are positioned near light sources or something.
For a sound meter you could probably gauge this based on moving speed of the player, or if they’re sprinting. Also log every action that they perform that gives off sound around a specific location, and then you could use bindable events to pass this action to NPCs as well to determine if the distance between the location where the noise occurred is close enough for the NPC to hear it.
And like mentioned above, you can use dotproducts to get a scalar (basically a value ranging from -1 to 1) from comparing two looking directions. You can use this to determine if the player is in line-of-sight of the NPC. (the smaller the scalar, the less difference there is between the two look directions)