- Home /
Question by
rooskie · Oct 06, 2016 at 07:54 AM ·
rigidbodyfps controllerstandard assets
3D object leaning away from my FPS
Hi,
I'm working on a 3D shooter, I got the FPSController from Standard Assets walking around etc. I also have some bots that I've created in blender, those shoot at FpsController. The problem is that when I get close to the bot starts to lean away from my Fps and then jump away. I'm adding a few screenshots that will hopefully explain what I mean.
That thing on the left is the bot with it's collider and the green square on the right is the FPS controller.
And this is bot's collider and RigidBody settings.
I'm pretty sure that there is nothing in my Fps that would push the bot away.
Any suggestions? Cheers!
screen-shot-2016-10-06-at-63351-pm.png
(45.8 kB)
screen-shot-2016-10-06-at-80342-pm.png
(31.3 kB)
Comment
Best Answer
Answer by Zodiarc · Oct 06, 2016 at 08:07 AM
You probably use lookAt with the player position.
Try this
this.transform.LookAt(new Vector3(playerTransform.position.x, this.transform.position.y, playerTransfrotm.position.z);
Your answer
![](https://koobas.hobune.stream/wayback/20220612094107im_/https://answers.unity.com/themes/thub/images/avi.jpg)