Returning to Scene scrolling Bug - Can some test my file!
JCFord
Member Posts: 785
I have created a simple test file which appears to have a bug in it, is there anyone who could look at this file for me and let me know what's causing the bug and a possible solution!
I have two scenes, both of which have a large canvas area so when you move the player around which has a Control Camera Attribute on it the screen scrolls.
There is an actor in each scene that on collide will take you back to the previous scene - so you can move back and forth between the scenes!
Each scene scrolls when you start off in it, but when you return back to the scene the scrolling stops working and the player disappears off the edge of the screen its almost as if on returning to the scene the Control Camera attribute appears to have been stripped out?
Can anyone help!
I can email you the test file!
I have two scenes, both of which have a large canvas area so when you move the player around which has a Control Camera Attribute on it the screen scrolls.
There is an actor in each scene that on collide will take you back to the previous scene - so you can move back and forth between the scenes!
Each scene scrolls when you start off in it, but when you return back to the scene the scrolling stops working and the player disappears off the edge of the screen its almost as if on returning to the scene the Control Camera attribute appears to have been stripped out?
Can anyone help!
I can email you the test file!
Comments
But off the top of my head, could this be happening:
You said that the actor collides with a trigger that sends the game to the prev/next scenes...
When you restore the preserved scene, isn't the actor still hitting the trigger? like it was before you jumped scenes? might that be causing it to wig out?
Good idea I tried it so that before it changes scene it moves the trigger to a different co-ordinate so on returning they are not in contact with each other but the issue is still there?
Whats odd it that if I turn the Preserve Scene to off the scrolling works in all scenes however much you go back and forth from scene to scene, but as soon as I turn Preserve Scenes on (which is what I need in the end) then the scene stops scrolling on returning to it - it like the Control Camera Attribute is getting stripped out?
I know your busy, but if you would have the tie at some point to give me your point of view I would be very thankful.
Bluefusion
joe AT firemaplegames DOT com
First, in your GoBackScene and GoNextScene actors, delete that Rules you have in both of their prototypes.
They don't belong there. You are just overwriting them with Rules in the Instances anyway.
To fix the problem you're having, simply add this Rule to the Player Actor:
Rule
ANY
When Actor receives event Overlaps or collides with Actor of type GoBackScene
When Actor receives event Overlaps or collides with Actor of type GoNextScene
Change Attribute self.Motion.Linear.X To: 0
Change Attribute self.Motion.Linear.Y To: 0
Good luck with the rest of your project!
Joe
Tried your solution above but this still does not work!
I think this is a bug in the Control Camera Attribute when returning back to a Scene.
The only way I get get this to work is to wrap the Control Camera up in a Timer Every 0.1 second, which works in terms of the scenes all now scroll when returning, but this is not the correct way, and ends up causing the app to crash!