Scrap/Random Hacks/Follow Code.txt
Richard Wright 5f35433c9b Scrap codes
2015-03-01 17:03:11 +00:00

16 lines
No EOL
585 B
Text

base.localAvatar.collisionsOff()
from direct.interval.IntervalGlobal import *
toonFollowing = base.cr.doFindAll("NameOfToonYouWantToFollow")
def updatePos():
base.localAvatar.setX(toonFollowing[0].getX())
base.localAvatar.setY(toonFollowing[0].getY())
base.localAvatar.setZ(toonFollowing[0].getZ())
base.localAvatar.setH(toonFollowing[0].getH())
base.localAvatar.setP(toonFollowing[0].getP())
base.localAvatar.setR(toonFollowing[0].getR())
def onMovment():
mov = Sequence()
mov.append(Func(updatePos))
mov.append(Func(onMovment))
mov.start()
onMovment()