News › Forums › RAIN › General Discussion and Troubleshooting › Rotation face problem
This topic contains 25 replies, has 3 voices, and was last updated by Pavel 1 year, 9 months ago.
-
AuthorPosts
-
January 23, 2023 at 9:54 am #6590
Hi, I have rotation face problem with rain, my enemy/player moves sideways. When my Player controlling by Rain, he rotate on 90 degress and went sideways, may be because my model rotated on 90 degress(for platform game). How can i tune Rain correctly? How i can say Rain what my model rotated 90 degress and rotate to normal angle(-90)?
On Unity Forum i was added images and some posts but nobody answered me for the time being.
http://forum.unity3d.com/threads/167791-RAIN-indie-Free-Powerful-AI-Engine-Released/page15?p=1492933&viewfull=1#post1492933January 23, 2023 at 2:37 pm #6595Looks like you are making a 2D game. Currently RAIN only manages character facing and movement when the world axis is Unity 3D default (Y up).
January 23, 2023 at 6:29 pm #6599Yes I make 2d game(with 3d graphics), and do nothing? Are you add change face angle in future?
January 23, 2023 at 6:46 pm #6600And i have problem with detect Enemy, when my player detected Enemy with 100 health and then(when he going to Enemy) detected Enemy with 0 health he stoped. How change this that Player don’t detect Enemy with 0 health and don’t stop?
I create some fast kills when pressed keys and Enemy near went to the enemy and kill him with knife then do something…and this already worked(like Far Cry 3(more) or Assasian’s Screed) and this with help Rain.January 23, 2023 at 6:49 pm #6601January 23, 2023 at 7:57 pm #6605And i have one more question. Can i detect ledges used Rain Navmesh(for ledge grabbing or climbing) or better use this post http://gamedev.stackexchange.com/questions/40302/how-do-i-detect-ledges
January 25, 2023 at 9:00 pm #6626I decided problem with face rotation. I create varible(Rain AI) in player controller script and this varible assign to face AI Actions(on move and face Actions in the Behavior Tree)
Code on Player(in Update method)if(transform.rotation == new Quaternion(0,-1,0,0)) {// Right stateRight = true; aiStateV = new Vector3(0,0,-180000); } if(transform.rotation == new Quaternion(0,0,0,1)) {// left stateRight = false; aiStateV = new Vector3(0,0,180000); } aiRig.AI.WorkingMemory.SetItem<Vector3>("stateRight", aiStateV);
I add more angle because if use 90 or 180 degrees my Player model does not turn to the end.
January 25, 2023 at 11:08 pm #6632I don’t think I understand most of what you are asking. However:
1) If you want to stop detecting something, disable its Aspect (set aspect.IsActive = false)
2) No, the RAIN NavMesh doesn’t currently keep meta information about jump points, ledges, etc. You would need to do that with either Sensors/Aspects or some custom code (or use some other navigation system that does support it.)
3) Maybe the Face problem is caused by your close enough angle being too large?January 26, 2023 at 11:39 am #6638My close enough angle = 0.001
Thanks it’s working aspect.IsActive = false, but i have got access in codeusing RAIN.Entities; ... EntityRig tRig ... start() tRig = gameObject.GetComponentInChildren<EntityRig>(); ... update() if(health <= 0) tRig.Entity.IsActive = false;
But now my Plyer kill everything 😀 if detect. But i want one by one. If i can not handle with this i post correct question, i think it’s may be behavior tree problem.
January 26, 2023 at 12:02 pm #6639Ok I decided this problem in behavior tree i have selector -> and two constraint (move and attack like your soldier tutorial) sometimes attack constraint stuck and don’t return to main constraint(when check enemyhealth and resolution variable), and this attack constraint i set repeat forever and done)
January 30, 2023 at 7:54 pm #6732But all the same i have some bugs. If Player sensor detect Enemy and Enemy go out from sensor, Player attack on near Enemy but if near Enemy havent Player stuck or if Player detect another Enemy he attack and kill him but without animation(on Enemy). When player go to enemy and attack him on enemy playing animation but if there is something that I have described above on Enemy didn’t playing animation.
Animation on Enemy need for fast kill if “fastkill = true” one on Enemy playing animation and then -> ragdoll else(if some bullet) ragdoll at once.
I have this code for choice transition to the animation(and then ragdoll) or ragdoll at once:
if i pressed keys and have enemy on sensor thenif(aiRig.AI.WorkingMemory.GetItem("enemyhealth").GetValue<float>() != null) if(aiRig.AI.WorkingMemory.GetItem<GameObject>("aimTarget") != null) aiRig.AI.WorkingMemory.GetItem("EnemyP").GetValue<GameObject>().GetComponent<Health>().fastkill = true;
How correct this? May be like that if Player detect Enemy and Enemy go out “fastkill = false” or if Player detect another Enemy kill him with animation or go to the detected Enemy.
February 4, 2023 at 6:59 pm #6838Anyone answer, Prime
February 21, 2022 at 8:50 pm #8198…
February 25, 2022 at 1:30 am #8408Sorry - I’m still having trouble following your description.
Here’s one thing I can tell you: Don’t do this
if(aiRig.AI.WorkingMemory.GetItem(“enemyhealth”).GetValue
() != null) Instead, do this
if (aiRig.AI.WorkingMemory.ItemExists(“enemyhealth”))
February 25, 2022 at 1:30 am #8409Maybe it would help for you to post or send your BT XML. You can export it from RAIN 2.0.10
-
AuthorPosts
You must be logged in to reply to this topic.