playMaker

Author Topic: Following the camera and moving [SOLVED]  (Read 2172 times)

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Following the camera and moving [SOLVED]
« on: August 17, 2016, 03:21:46 AM »
Hello,

i have a simple FSM for moving the spaceship around (get axis and set velocity2d). I have a moving camera so the ship has to follow the camera and retain its ability to move at the same time. I can't seem to wrap my head around it, either i set the ship to follow the camera, but i can't move it, either i can move the ship but it doesn't follow the camera, please help! It's a classic shmup setup that i can't seem to recreate.

Here's the FSM i'm using

« Last Edit: August 18, 2016, 04:57:56 AM by krmko »
Available for Playmaker work

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Following the camera and moving
« Reply #1 on: August 17, 2016, 12:44:51 PM »
Hi,
Maybe This Tutorials Series can help you out : New SHMUP Tutorial Series!

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Following the camera and moving
« Reply #2 on: August 17, 2016, 01:51:20 PM »
Hi Djaydino, i'll check it out. I'll also try some regular scripting and publish it on the forum, someone might need it too.
Available for Playmaker work

Sid

  • Playmaker Newbie
  • *
  • Posts: 32
Re: Following the camera and moving
« Reply #3 on: August 17, 2016, 03:21:54 PM »
Can you just make the ship a child of the camera and move it locally?

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Following the camera and moving
« Reply #4 on: August 18, 2016, 03:07:30 AM »
By watching tutorial djaydino gave me i made a parent object which contains both the camera and the player with the translate action (which moves object without rigidbodies i.e. unaffected by physics) and set it to late update with self as space. Now, because my ship moves with set velocity, it also needs to have fixed horizontal movement without physics involved. So, i put translate on the player too, with late update but world as space. It works, but the ship has a noticeable jitter :o

And i tried Sid's solution, it works perfectly, child ship under the camera, and move with translate instead set velocity :)
« Last Edit: August 18, 2016, 03:37:37 AM by krmko »
Available for Playmaker work