ceriux wrote:if you wouldnt mind explaining what you changed and why?
Do you mean between the two versions that were posted?
It seems like it should be creating a new entity that can be referenced by self since self.camera should just be pointing to the new empty entity that was spawned with self.camera = spawn()... Then the fields are filled in. The same goes for "entity camera" except it can't be assigned to other entities like self. If you had .entity camera and entity ccamera then you could spawn ccamera and make self.camera = ccamera to grab fields from ccamera...
When the entity gets spawned it then ceases being !camera (or !self.camera). In the original code, it needed !self.camera to know it was off.
It was also no longer !self.camera after it was removed and it would try to apply the origin change to self.camera even though it had been removed(and you can't set the origin of a free'd entity). This is also why it wouldn't respawn after being removed.
It now uses the same field .float aflag that you were using as a toggle now.
That said, it should have worked as either .entity or entity as long as it doesn't try to use ! as "off" after it has been spawned and then subsequently removed.
ceriux wrote:( i had to change a few entities and .entities around .entity camera was conflicting with entity camera so i just changed .entity camera to ccamera...)
Well, you can't have a .entity and an entity of the same name because then it has no idea what kind of data you want it to be... This applies for anything... You couldn't have a .entity camera and a float camera either.
ceriux wrote:also can someone point me in the direction of altering players to where they only move left to right ?
One way would be to design the maps in a certain way and feed it a constant for origin_x. Or, you could grab the starting origin vector and make it so that it stays at the same origin_x for example... This should help to stop from being pushed if you collide with an object. If you had only just removed the buttons you could still move along x possibly if it "slides around" an object.
ceriux wrote:(apolluwn you will be receiving credit in the readme.)
I really can't take credit for any of that.
It was really just a modified version of the chasecam in Ender's scratch tutorial except now when it is on it keeps the player facing at a constant angle, the camera moved out from the player origin on the x-axis 128 units, and the camera angle is changed to turn back towards the player...
It would probably be worth checking out some of RenegadeC's stuff. I'm pretty sure he had a few different versions of platforming cameras himself that were much better than this and just seeing how he accomplished it would probably give you some ideas as to how to improve your camera.