playMaker

Author Topic: Camera Movement along one Axis [SOLVED]  (Read 1850 times)

Mornar

  • Playmaker Newbie
  • *
  • Posts: 40
Camera Movement along one Axis [SOLVED]
« on: November 03, 2014, 04:18:45 AM »
Hi

Does anybody knows a good way to follow an object only on one axis.
Its a top down spaceshooter in a mobile portrait view but i want a bigger world.

I am moving my ship without physics and everything's fine but how can I make my camera follow the ship.

I tried it like this.
Get Ship Postion, store it in a float variable and the translate the camera with this float. But this is not giving me the result i expect.

How would you do it? Is there a way i have simply forgotten?

Greez
« Last Edit: November 05, 2014, 07:58:41 AM by Lane »

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Camera Movement along one Axis
« Reply #1 on: November 03, 2014, 03:12:18 PM »
You can use Get Position and return a float on one of the Axi (like X, for instance). Then you can just use Set Position for the camera and inject that float into the X field.

Basically it just gets the position on the X, then makes the other object the same. Make sure they're both set to World, and not Self.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

Mornar

  • Playmaker Newbie
  • *
  • Posts: 40
Re: Camera Movement along one Axis
« Reply #2 on: November 05, 2014, 07:45:58 AM »
Thank you. Oh man its embarrassing^^ Its really that easy.
I tried it in so many diffrent ways and they were much more complicated. :)

Thanx Alot