[SOLVED]sticky camera...

Wrong question,sorry . Solved

This post did help me to understand the cam behaviour and how manipulate it.

didnt quite help

I have another programming question: im trying to make collisions by using the code from RoamingRalph.
In the class there is a variable “isMoving”

isMoving = False

it then gets accessed by a function (method) of that class: “def move(task)”.
The thing is if the variable and function are not in a class i get an error:

local variable 'isMoving' referenced before assignment

,while i have declared the variable before the function. What can i do in this case? I tried

global isMoving
isMoving = False

Doesnt seem to be it

Aah! Yet it explained all basics you need to manipulate the camera!

Using piece of code that someone else wrote is having the advantage that you don’t have to re-write the whole stuff yourself BUT ALSO the desadvantage that it’s not coded for your convenience and that you’ll loose most of your time trying to understand coder’s mind instead of learning by your own… (that’s my opinion)…

Did you try easier way before that like reparenting camera to the player ?
Roaming Ralph exemple is also a must startpoint :wink:

The “self” here is very important!
In the Ralf exemple, self.isMoving = False is declared in the init of the class --> you can then use it whenever you want within the class.
If you remove the self , your variable will stay local to your function and you can’t use it outside that function.

im not writing it in a class.
Edit: didn’t know how global variables work in Python. Solved