Post by ventus on Jan 12, 2024 11:29:02 GMT
Hello!
In game that i develope i'm using Invector TPC (shooter) for controlling player and have a plan for using it for simple controlling NPC.
Here my cases, i need advice - can i make all of it without FSM?
1. NPC going to endpoint though multiple waypoints, with a smooth way is possible. Every NPC can have many ways with a switch between them
Looks like it can be implemented by using vWaypoingArea, but i can't found good way for choosing specific waypoint script if many of them connect to one navMesh.
2. NPC rotate their head to track player position.
I have a thought that vHeadTrack can help, but it's not.
3. NPC do some actions with environment, like put_card in example scene
I haven’t delved into this case much yet, thinking about vTriggerGenericAction, is me on right way?
4. NPC stop their current action and rotate to player (for conversation)
I can make it by set MoveToSpeed=0 and switching moveTo target, but it sounds rly bad May be exist simple way by using asset functions?
5. NPC simply move to point
Oooooh here my brain was explode. I spend 2 day for research why AI rotate to target but not moving, looking for strong problem, and solve it simple just by change protected float _moveToSpeed; to protected float _moveToSpeed = 1f; in asset code. (The one place there it can be set is vSimpleMeleeAI_Controller->MoveTo but this func is never used) Now i understand asset logic much better , but i can't stop thinking that i do something wrong. Is at a bug that this variable are can not be changed in editor?
P.S. got a lot of warnings "Setting linear velocity of a kinematic body is not supported." raised by code _rigidbody.velocity = animator.deltaPosition; . Read that it caused by new physX verion in Unity 2022, is it something i must worry about?
In game that i develope i'm using Invector TPC (shooter) for controlling player and have a plan for using it for simple controlling NPC.
Here my cases, i need advice - can i make all of it without FSM?
1. NPC going to endpoint though multiple waypoints, with a smooth way is possible. Every NPC can have many ways with a switch between them
Looks like it can be implemented by using vWaypoingArea, but i can't found good way for choosing specific waypoint script if many of them connect to one navMesh.
2. NPC rotate their head to track player position.
I have a thought that vHeadTrack can help, but it's not.
3. NPC do some actions with environment, like put_card in example scene
I haven’t delved into this case much yet, thinking about vTriggerGenericAction, is me on right way?
4. NPC stop their current action and rotate to player (for conversation)
I can make it by set MoveToSpeed=0 and switching moveTo target, but it sounds rly bad May be exist simple way by using asset functions?
5. NPC simply move to point
Oooooh here my brain was explode. I spend 2 day for research why AI rotate to target but not moving, looking for strong problem, and solve it simple just by change protected float _moveToSpeed; to protected float _moveToSpeed = 1f; in asset code. (The one place there it can be set is vSimpleMeleeAI_Controller->MoveTo but this func is never used) Now i understand asset logic much better , but i can't stop thinking that i do something wrong. Is at a bug that this variable are can not be changed in editor?
P.S. got a lot of warnings "Setting linear velocity of a kinematic body is not supported." raised by code _rigidbody.velocity = animator.deltaPosition; . Read that it caused by new physX verion in Unity 2022, is it something i must worry about?