Hi, I’m trying to make my camera kind of just float/hover in the air smoothly, in a way that it moves up and down, kind of like if its a drone on the air.
Of course this script wont do the job, but it does move it up and down, but I cannot figure out how I can slew this motion, and also how to have some sort of ‘flag’ that is at True or False if its reached its maximum height or minimum, to prevent it from going down again once its not in the minimum Z value.
What happens with this script currently is just this very glitchy bouncing, very rapid.
Anyone got tips on how to make this work? I got no idea.
def camHover(self, task):
deltaTime = globalClock.getDt()
camZ = self.camera.getZ()
cam = self.camera
if camZ <= 20:
cam.setZ(camZ + 1)
if camZ >= 20:
cam.setZ(camZ - 1)
return Task.cont