So, Im making a skill game with a custom character (3rd person perspective using directional forces glued to the custom character, and i started using https://docs.google.com/drawings/d/1...F4g/edit?pli=1 this tutorial to have an enemy always facing the character, and it works great, except:
The trigger that activates the enemy is in a 3D world. So If the custom character isnt facing the enemy when its triggered, the rotation is all out of whack, like his back or side rotates to face you.
Is there a better way to do this? Basicly I just want a certain side of an object to face the character, regardless of where the object appears on the map.
It should also be noted that I made a slight change to this tutorial, the data sources for the custom character come from the actual character, not the camera.
ope a camera to the location of the enemy just place a static one if the enemy doesn't move(camera target your character, range 0.01, enabled)
take the vector info rotations of the camera and put those in the ope(global) that rotates the enemy
this should work always
Interesting. By rotation vector, you mean angle xyz? Seems so much simpler! The camera never accidently activates this way?
the object info vector(angle) or object info datascouces if you want that but the vectors one is shorter 1 vs 3 datasources
camera can activate on accident if it enters the range
and you might need to rotate your glue pivot so it has the same axis as your camera
The way your character is facing should have no effect on your enemy's rotation.
Are you sure you haven't switched around the operands on the ArcTan2 function?
Im sure. The rotation still technically works with this method, like say for simplicity's sake the game character starts out facing north, walks up a hallway, and hits an area trigger, activating the enemy who is waiting on the sidelines, facing south. This is all good, the enemy rotates with his face toward the game character. But lets say I use the same code walking down a hallway facing west. The enemy still rotates toward the game character, but it is constantly facing the game charater with its side. (its "east" side")
Anyway, the camera method seems to work great, depending the glue group of the enemy i have to adjust the angles given with two input operaters, but it seems to work flawlessly.
its better to place a glue pivot in the right direction and glue your enemy to that because 2 input operators can mess up if you use it to rotate more than 1 axisOriginally Posted by j0nnystr0ng
Have you checked "set rotation" in the OPE?