Game Development Community

PSK Parallax Scroller not working

by Greg C · in TGB Platformer Kit · 08/31/2011 (5:48 pm) · 3 replies

I am attempting to do some of the things in the starter kit demo level tutorial. When I attempt to add a parallax scroller with the mentioned instructions, the mountains do not move when the camera moves. I am using TGB 1.7.5 pro.

The demo level tut can be found here: http://tdn.garagegames.com/wiki/TGB/PlatformerStarterKit/Demo_Level

Thank you.

#1
10/29/2011 (8:54 am)
Hmmm, I'm getting this problem too.

I put a breakpoint in the ParallaxBehavior.cs file, in the onUpdate() function. Right at the beginning of the function, it checks to see if you have a valid ParallaxScrollTarget object with this code:

if ( !$ParallaxScrollTarget )
{
return;
}

It never makes it past this check, so the code which actually does the scrolling etc. is never called. Any suggestions on how to fix this?
#2
10/30/2011 (2:18 pm)
I had this problem. On your playet's onAddToScene, add

$ParallaxScrollTarget = %this;
#3
07/13/2012 (1:43 pm)
Awesome, thanks for the help Luis.