playMaker

Author Topic: (SOLVED) How to Rotate camera around player (like most 3rd person games)?  (Read 1598 times)

Qbanyto

  • Full Member
  • ***
  • Posts: 137
  • Vista Larga, Paso corto
Hey guys. Long time reader, this is my first post.

Loving playmaker so far!

So After 6 hours and 30 million videos later (lol) I finally got the majority of this working. I was able to get my camera following my character using this video by Hutong which I love how it works. This whole series has triggering cameras too:


My question is, how can I make it so that I can rotate camera around the player at will like gta or assassins Creed?

I’m thinking mouse look has something to do with this but my camera starts flying away when using the mouse look with the video above. I REALLY like that system above and don’t want to refrain it or change it to much.

And I would like to able to change the mouse controls To the right analog stick control in the future. But I just wanna get this thing working lol.

I’m thinking maybe parent an empty object to the player and constraint it’s rotation to the mouse and have the camera follow that rotation? Would I have to create a variable?

I swear I’m so close to figuring this out lol! What do you guys think any advice?
« Last Edit: August 27, 2020, 02:39:19 PM by Qbanyto »

spengrantest

  • Playmaker Newbie
  • *
  • Posts: 4
Re: How to Rotate camera around player (like most 3rd person games)?
« Reply #1 on: August 27, 2020, 08:42:42 AM »
Hey there, just got this working on my end, (it's more fickle than I expected ^^)
So, step one: Parent an empty GameObject to your player, then parent your camera to that! You now have an invisible object that moves exactly when your player does, and a camera following that object as opposed to the player. You have to do this since there's no built-in way in unity that I could find to change the origin point of an object, so you have to forcibly add a point for the camera to rotate around.
If you try to just parent the camera to the player, then whenever you move the mouse the player model would move with it.
Next, in any state you wish add a mouse look or mouse look 2 action. They're essentially the same as far as I can tell so it shouldn't matter which. I personally added this FSM to my camera simply so I know where it is at all times.
If you added the SFM to anything other then the empty GameObject, in the mouse look action where it says "Game Object", change it from "Use Owner" to "Specify Game Object", and in the box that appears click the little target icon and select the empty GameObject you made. Now all you have to do is run the game and it should work fine! Be aware the default sensitivity of 15 is VERY high, I personally turned it down to five and that's much more workable to me.
Hope this works out! if need be I can make an imgur page with screenshots!

Qbanyto

  • Full Member
  • ***
  • Posts: 137
  • Vista Larga, Paso corto
Re: How to Rotate camera around player (like most 3rd person games)?
« Reply #2 on: August 27, 2020, 02:38:54 PM »
Actually I figured this out weeks ago but using cinemachine free look and basically something similar to what you described. I forgot to update this but thank you for your efforts. 😀