SetMesh Actuator problem


Hey guys this worked for me before But, it aint working anymore , maybe cuz of 2.49 , how should i make it work ? this is the script



import GameLogic as g
cont = g.getCurrentController()
own = cont.owner

scene = g.getCurrentScene()

objWeapon = scene.objects["OBWeapon"]
    
Weapons = cont.getActuator("Weapons")

if objWeapon.BigginerSword == 1:
    Weapons.setMesh (BigginerSword)
    g.addActiveActuator(BigginerSword,1)

This might help: http://www.tutorialsforblender3d.com/GameModule/ClassKX_SCA_ReplaceMeshActuator_1.html

Sweet thanks! ill check it out and see if it works :wink:

Funny. You use bigginerSword in three different ways:

  • as an attribute/property: objWeapon.BigginerSword {with 2.49 it should be objWeapon[“BigginerSword”] - this is still ok}
  • as an mesh name: Weapons.setMesh(BigginerSword) {BigginerSword is not defined in your script - this should produce an error}
  • as an actuator: g.addActiveActuator(BigginerSword,1) {BigginerSword is not defined in your script - this should produce an error}

I hope it helps

yes i used it as a property to organize better, yes i use it as a mesh because the sword its called “bigginer sword” and yes i use it as an actuator because thats the actuator that will replace the mesh for the biginer sword

And no, there is no error produced :wink:

@ Thanks Pret that helped , its working for me now :wink: