Closed S7vie closed 1 year ago
Are you using the Chase Example mechanic from the source?
Keep in mind examples are made for users to understand the uses of AIEngine.
Can you provide more details such as the lua code of where the issue happen?
Yes, I'm getting on studio in a bit and I will send you the printed info and the lines of code.
Do keep in mind; I don't have much experience with making AIs
And there's another bug where the AI runs into walls and stops there [Roaming Mechanism] but it's probably the AgentParams that I have to modify
Apologies for the crappy quality : Roblox being itself
Where are the prints located for you debugging on when the AI stops chasing and starts?
If the state changes rapidly it could well effect the Chase.
Try using the AI's api OnStateChange
and print the value of the new State, and while testing check for any rapid changes in the State.
Another debug attempt you can try is print/warn inside the heartbeat, you should print AI.TargetPlayer
, and the Player
from scanner, before ChaseStarted is fired.
I would have to take a look at the example mechanics myself.
The state does not change, in the image I sent where the AI was chasing, on the other side the Output is visible; showing the prints
Oh, the prints on the code?
I'll send in a bit.
Can you add me on [Discord]: ( 7_81C )[Username]
Since, I have to wait like at least [a hour] for a reply on here
And if you're asking if I do need help, then yes; it's not a small bug that I can pass on from, it affects the gameplay (how?) I will explain there
Solved
Okay so, I'm not sure if this is a bug or not but, I put debugging on the
OnChaseEnded
OnChaseStarted
events;Note: Theres a [StringValue] titled "State" in the AI which controls some things like playing a spotted sound after the player has been seen and I modify its value upon the firing of the events (if that makes sense)
When the AI chases, it prints Not Chasing and Chasing(from the debugging I put) at the same time while the AI is chasing a Player now I haven't tested this AI yet with 2 Players but it does that for some reason
before I put the modification of the State value on the
OnChaseEnded
andOnChaseStarted
events but since they were repeating I had to move them to where the AI chases the PlayerAI.Movement:MoveTo(PlayerPosition)
and that works but I still don't get why it repeats it