Hi I’m back with pawnsensing stuff! Different project this time.
So I followed a simple tutorial to a T, which had you put pawnsensing on the player to be able to tell an AI to move and not move when being looked at/not looked at (weeping angel style). But it doesn’t seem to be working at all. The strange part is when I set up a ‘seeing’ and ‘not seeing’ print string on the respective lines and play it seems to get stuck on ‘seeing’ line no matter what I do. To top it off, character movement doesn’t seem to get disabled on ‘seeing’ either. Any ideas what’s going on?
The movement of the AI walking towards me is a simple looped ‘AI move to’
Here’s a video of what I mean when the Looking/Not looking thing is bugging out and movement wont work.
I noticed the only time it makes it to “Not Looking” is when you put the fountain in between and break LOS so that’s working for sure, except it still says “Looking” when you’re looking away from it. You may need to adjust the cone of vision!
I think you also need the “Stop Movement Immediately” node because what’s happening is the AIMoveTo node is determining it’s path while you’re not looking, then because that path is set, when you look it doesn’t stop.
I actually did add that before, re-adding it causes it to stop and never move again. Strangely enough this seems to break the pawnsensing altogether, it will occasionally show looking or not looking but almost always shows nothing. D:
Edit
Sorry I missed the cone comment.
I have been adjusting it anywhere between 45 and 70 (the player’s view) and neither seems to make a difference unfortunately.
Okay, Stop Movement Immediately should not interact with pawn sensing in any way… it just puts on the brakes and stops movement, nothing else. Do you think you could get us video of what is happening, a pic of your code, and your pawn sensing settings?
Sorry I was knocked out from being not well all day, just got on pc!
Unfortunately I’m aware ‘stop movement immediately’ shouldn’t affect anything like that that’s why I’m definitely confused!
Here’s the video of what it’s doing now, you can see it starts with ‘looking’, drops a ‘not looking’ (I think my cone of vision is around 45 so pretty low rn) and then stops registering altogether the entire rest of the time. The statue doesn’t move whatsoever after an initial twitch when I first drop into the game.
Here’s the follow code (if needed) and the stop-go code
Edit
Strangest thing I have noticed playing around with it more! If I’m looking at it directly it will not say ‘looking’ OR ‘not looking’ at all. But if I put the fountain between me and the statue, it will say ‘looking’. ONLY with the fountain will it re-trigger the looking and not looking lines, but I still can’t get the statue to move at all.
Make sure to use an “On Fail” Printstring, that can help troubleshoot. If it fires it lets you know of a for sure problem but if it doesn’t fire nothing is changed. AI MoveTo is not the stablest.
Try moving your Navmesh a tad. When working with AI it’s good to have it visible at all times- “P” on the keyboard with the viewport selected out of game. It often will break randomly so it’s good to watch, usually just moving it a tiny bit and making it redraw works fine as a fix.
So now this is a problem of “Where and When is the problem happening?”
This is what printstrings are good for! Putting some like this will let you know if the nodes in between are causing an issue.
As far as the “Looking” and “Not Looking”, Make your collisions on the statue and the fountain visible- it’s possible the overlap is creating a blockage and weirdness. Otherwise it LOOKS like you’ve got them backwards somehow. Maybe instead of doing a Cast To first, check if the class = the class you’re looking for? I don’t know, there’s not much more I can surmise from this information. But I hope it gets you on your way!