#Ai get rotation help

27 messages · Page 1 of 1 (latest)

rustic edge
#

I made Ai skeleton pathfinding but i just need a simple thing which is make the monster model i made face the same rotation as the ai because i cant use velocity or rotation for ai

#

Ai get rotation help

#

How do i track the rotation of Ai

jagged python
#

I believe there was a way to do this by getting their position, and comparing it to their position on the next tick.

#

Also why did you delete your original message? I see people do that alot and it bugs me, you can just edit it if you got something wrong in it.

rustic edge
#

Because i first needed to make a pathfinding system but i figured it out now i need the rotation

brazen thistle
# rustic edge I made Ai skeleton pathfinding but i just need a simple thing which is make the...

To get the rotation as a quaternion of a Player or Rec Room Object, you can use the "Get Rotation" chip.

Using your makerpen, spawn in a "Add Tag" chip, a "Rec Room Object Get First With Tag" chip, and a "Get Rotation" chip. In your makerpen menu, select the "Connect" tool. Connect the "Exec" output labelled "Object Spawned" on your Spawner Component's object board to the "Exec" input on the "Add Tag" chip. Connect the "Rec Room Object" output labelled "Object" on your Spawner Component's object board to the "Rec Room Object" input labelled "Target" on the "Add Tag" chip. Using the "Connect" or "Configure" tool in your makerpen menu, select the "String" input labelled "Tag" on the "Add Tag" chip, and configure it to be "AI", or something similar (I will refer to this value you inputted into the "Add Tag" chip as "AI"). Using the "Connect" or "Configure" tool in your makerpen menu, select the "String" input labelled "Tag" on the "Rec Room Object Get First With Tag" chip, and configure it to be "AI". Using the "Connect" tool in your makerpen menu, connect the "Rec Room Object" output labelled "Object" to the "Rec Room Object | Player" input labelled "Target" on the "Get Rotation" chip.

The "Quaternion" output labelled "Quaternion" on the "Get Rotation" chip is the rotation of the earliest currently existing object spawned by your Spawner Component as a Quaternion.

You may wish to spawn multiple objects with the Spawner Component and get each of their rotations separately. To do so, you can replace the "Rec Room Object Get First With Tag" with a "Rec Room Object Get All With Tag", connect the "List<Rec Room Object>" output labelled "Objects With Tag" to the "List<Any>" input labelled "List" on a "List Get Element" chip, and connect the "Rec Room Object" (previously "Any") output labelled "Value" on the "List Get Element" chip to the "Rec Room Object | Player" input labelled "Target" on the "Get Rotation" chip.

fleet roost
#

iirc it always outputs the same direction

#

no matter where it's actually looking

#

might be fixed, but knowing rec room's attention to AI, it probably isn't

rustic edge
#

Thats a lot it'll be hard to try

#

I'll try it

brazen thistle
# rustic edge I made Ai skeleton pathfinding but i just need a simple thing which is make the...

(Continued × 1) The "Int" input labelled "Index" on the "List Get Element" chip is the index of the object in the list of currently existing objects spawned by the Spawner Component that you wish to get the rotation for. However, instead of this, you can also give each of the spawned object a unique tag, and get the rotation of a specific tag (feel free to ask if you need help setting up such a system).

Let me know if this helps.

brazen thistle
jagged python
#

@brazen thistle currently you cannot get the rotation of an AI, its a bug

rustic edge
#

But i want to track one ai goblin is it hard to do?

jagged python
#

I believe you can still use combatant get ground position chips though and save the value each tick, subtracting it from the unsaved value of the next tick before setting it again to get the direction they are moving, which will also be the direction they are facing since the AI don't really turn just their heads but rather their whole body

#

Just make sure the exec runs through the vector variable chip after you've done everything you need to with the saved and unsaved vectors.

rustic edge
#

I'll try that

#

I'll update if it works👍

jagged python
#

Okie

hot oasis
#

you can just use combatant get velocity

brazen thistle
rustic edge
#

I dont think it works

#

It does work but it keeps rotating the other way

jagged python