Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: ... on August 17, 2016, 03:21:46 AM

Title: Following the camera and moving [SOLVED]
Post by: ... 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

(https://s3.postimg.org/xgliy4ygj/image.jpg)
Title: Re: Following the camera and moving
Post by: djaydino on August 17, 2016, 12:44:51 PM
Hi,
Maybe This Tutorials Series can help you out : New SHMUP Tutorial Series! (http://hutonggames.com/playmakerforum/index.php?topic=13243.msg61655#msg61655)
Title: Re: Following the camera and moving
Post by: ... 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.
Title: Re: Following the camera and moving
Post by: Sid on August 17, 2016, 03:21:54 PM
Can you just make the ship a child of the camera and move it locally?
Title: Re: Following the camera and moving
Post by: ... 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 :)