Hey! I’m pretty new to blueprints and wasn’t even that good with Kismet, so I wonder how to create this:
A scary characer with visibility set to 0 is in the corridor, but if you walk past him and is facing in the direction of a box infront of you, he will appear behind you, and if you then turn around and looks at him, a sound triggers and maybe some AI features but that’s for another question.
That’s a big question Henke!
So first - scary is pretty difficult thing to determine. Some people are afraid of clowns, so we don’t really have a make scary blueprint node…yet. I’d recommend lots of fangs, maybe some blood and gore. Weird limbs tend to work well. Maybe little girls - they’re pretty creepy.
For collision you can place a collision volume in the level, and listen for the BeginOverlapping event, that will tell you when an object is touching it. “Casting” the object who hits the volume to a Player Pawn will tell you if it’s a player.
Next to figure out, can the person see the monster box. There are lots of good options there, you could attach a capsule or box and rotate it when the player looks around, then you could detect collisions with monster spawn boxes. Or you could do a line trace in the direction the player is looking to see if it hits the spawn box. Or you could check to see the angle between the player’s look direction and the line formed by the player position and the monster box’s position, is less than a certain angle when you apply the dot product. (Maths!)
Getting the monster to attack, well that’s a pretty big topic in an of itself. See if you can just get the monster spawning to work right I hope this helps get you started.
Cheers,
Nick (Epic Games)
Perfect answer, wish me luck!