playMaker

Author Topic: How would I make the camera move closer to the player when up against a wall?  (Read 2997 times)

gecken

  • Playmaker Newbie
  • *
  • Posts: 3
The title pretty much says it all here. I have a 3rd person camera set up right now that works pretty well for the most part. I can control it with my right analog stick on my controller, spin it around the character, move it up and down, ect. However, I've tried and tried to come up with a solution, but I can't seem to get the camera to zoom into the character when it's up against a wall, as it would in most 3rd person games. Any advice or solutions are greatly appreciated. Thanks in advance!

neowings

  • Playmaker Newbie
  • *
  • Posts: 25
Have you tried to apply Collision on Camera?

gecken

  • Playmaker Newbie
  • *
  • Posts: 3
Yup, but the camera doesn't actually move closer to the character, it just comes to a stop (and eventually if it moves at the right angle, it goes through the wall anyway, but that's another issue altogether haha).

karmacomposer

  • Playmaker Newbie
  • *
  • Posts: 6
I am trying right now to make a similar camera - how did you do it?  I have smooth look at enabled, but how can I make the camera move with the main character?

Wish I could help you, but first I have to make the camera move!

Mike

gecken

  • Playmaker Newbie
  • *
  • Posts: 3
Sorry for the delayed reply, haven't had the chance to check this for a few days.

As for the camera, I started by making an empty game object, placing it in the same position as the player character, and parenting it to the character. Then I added a rigidbody to the empty object and froze rotation. After that, on the camera I have a Look At action set to look at the empty object, deselect keep vertical, a Get Axis Vector action with horizontal and vertical axis set to whatever you set the right analog stick to in the input menu, a Translate action with the vector set to the vector obtained from the Get Axis Vector action, with every frame and per second checked, and finally a Smooth Follow action with the target set to the empty object, and a distance/height of your choice.

Hope that works for ya! :D