Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: Rabagast on April 03, 2015, 06:15:06 PM
-
Hi!
I try to make a 2D camera for a 2D space shooter like this:
https://www.youtube.com/watch?v=t9Qm6d9oS40 (https://www.youtube.com/watch?v=t9Qm6d9oS40)
I can make the camera follow the player, but as you can see in the video, when the ship moves to the right, the ship smoothly moves to the left. And if the ship moves to the left, the ship smoothly moves to the right. How can I do that? Any ideas?
-
Check this video instead. It looks like the other video only moves the the right. :)
https://www.youtube.com/watch?v=nxPoXjSgNFo (https://www.youtube.com/watch?v=nxPoXjSgNFo)
-
This is a bit complex to detail in one post so I to lead you in the right direction what you want to do is have the camera get the X on the players position and add +[num] to that X and set the position of the camera to that X to get it positioned in the middle.
The smooth switch from left to right can be down with a Smooth Lerp action so that when it moves over to the other side the camera lerps to that new position. So, study lerps and the action advanced lerp because that is the key to getting these smooth positions.
GLHF!
-
The only Lerp action I have is Vector3 Lerp. Is it this one I should use.
-
I found "Float Lerp Advanced" on the Ecosystem. Maybe it's this one.