Camera problem

from math import pi, sin, cos 
from direct.showbase.ShowBase import ShowBase 
from direct.task import Task 
import sys 
import direct.directbase.DirectStart  
from direct.actor.Actor import Actor 
from pandac.PandaModules import * 
import math

class MyApp(ShowBase): 
    def __init__(self): 
        ShowBase.__init__(self) 
  
        #self.environ = self.loader.loadModel("models/igrataegg") 
        #self.environ.reparentTo(self.render) 
        #self.environ.setScale(0.25, 0.25, 0.25) 
        #self.environ.setPos(0, 0, 0) 
        self.environ2 = self.loader.loadModel("models/4owek2") 
        self.environ2.reparentTo(self.render) 
        self.environ2.setScale(0.25, 0.25, 0.25) 
        self.environ2.setPos(0, 0, 0) 
        self.accept('escape', sys.exit) 
        self.accept('arrow_up', self.mods, [self.environ2]) 
        self.accept('arrow_down', self.mods1, [self.environ2])
 #       self.taskMgr.add(self.spinCameraTask, "SpinCameraTask") 

        teren = loader.loadModel("models/igrataegg")
        base.camera.setX(self.environ2.getX())# 10 = distance between cam and point 
        base.camera.setZ(self.environ2.getZ() + 50)
        base.camera.setY(self.environ2.getY() + 50)
    
    def mods1(self, task):
      
	   self.environ2.setY(self.environ2.getY() - 1)
	   base.disableMouse()
	   #base.camera.setY(self.environ2.getY() + 1)
	   dummy = self.environ2
	   #player = dummy
	   #dummy=render.attachNewNode("models/4owek2")
	   base.camera.reparentTo(dummy)
	   base.camera.setX(self.environ2.getX())# 10 = distance between cam and point 
	   base.camera.setZ(self.environ2.getZ() + 50)
	   base.camera.setY(self.environ2.getY() + 50)
	   dummy.setH(0) #this will rotate it 60 degrees around the poin
	   base.cam.lookAt(dummy)
		 
	 
	  
	
	    
    def mods(self, camera):
	     
		 base.disableMouse()
		 dummy = loader.loadModel("models/4owek2.egg")
		 #player = dummy
		 dummy=render.attachNewNode("models/4owek2.egg")
		 base.camera.reparentTo(dummy)
		 base.camera.setX(10) # 10 = distance between cam and point 
		 base.camera.setZ(10)
		 base.camera.setY(10)
		 dummy.setH(0) #this will rotate it 60 degrees around the poin
		 base.cam.lookAt(dummy)
		 
 
 #   def spinCameraTask(self, task): 
 #      angleDegrees = task.time * 6.0 
 #      angleRadians = angleDegrees * (pi / 180.0) 
 #      self.camera.setPos(20 * sin(angleRadians), -20.0 * cos(angleRadians), 3) 
 #      self.camera.setHpr(angleDegrees, 0, 0) 
 #      return Task.cont 
  
app = MyApp() 
app.run() 

I want to set the camera behind the object but every time when I hit arrow_down(mods1) the camera move colser to object.How to fix the problem?

Sorry, it’s not really clear what you’re asking. What do you want to happen when you press down?

To move the object whit the camera.And the camera to be with the same view