import direct.directbase.DirectStart
from pandac.PandaModules import *
from direct.filter.CommonFilters import CommonFilters
#Load the ship
viewm = loader.loadModel("ship.egg")
viewm.reparentTo(render)
x = 8
y = 16
z = 0
h = 0
p = 0
r = 0
s1 = 2
s2 = 2
s3 = 2
viewm.setPosHprScale(x,
y,
z,
h,
p,
r,
s1,
s2,
s3)
#Bloom
render.setShaderOff()
filters = CommonFilters(base.win, base.cam)
filters.setBloom(blend=(0, 0, 0, 1),desat=-0.5,intensity=2.0,size=1)
#Move the ship
if 1==1:
viewm.setY(viewm, y+1)
run()
I tried lots of other possiblities, but I just have no, no idea what is bad, is it that y is not going to get bigger or that the position doesn’t update?
The point is, that command gets executed only once.
Also, since you are setting the Y relative to itself the object will always be moving with speed 17 forward - I dont think that’s what you want, is it?
You should probably put this in a task. Put this before the run() call:
def moveTask(task):
# Move the ship 1 unit forward
viewm.setY(viewm, 1)
# Tell the task manager to continue looping this task next frame:
return task.cont
# Add the task to the task manager
taskMgr.add(moveTask, "move the ship")
Also, keep in mind that since you’re doing relative positioning, it will move with speed 2 instead of speed 1 (since the object is scaled).