I’m having some trouble setting the action for an action actuator using python. It’s for animations for getting in and out of vehicles. Here’s the part of the script that sets it:
if nearVehicle.positive: vehicle = nearVehicle.hitObject vehicleType = vehicle.get('VehicleType') enterVehicleAnim.action = vehicleType + 'Enter' exitVehicleAnim.action = vehicleType + 'Exit'
The VehicleType property (in this case it’s kestrelPilot, ‘kestrel’ is just the name of the vehicle design I found on deviantart.com) is used to get the enter and exit animations (kestrelPilotEnter and kestrelPilotExit).
It worked perfectly for the enter animation, but for some reason it doesn’t work for the exit animation unless the kestrelPilotExit animation is selected in Action Editor of the .blend file or the animation is put in the action space of the actuator. Otherwise the console gives me an error message saying the action wasn’t found, even though print(vehicleType + ‘Exit’) always returns kestrelPilotExit when I tested it. If I have to I’ll use different actuators for each vehicle action, but I want to see if I can fix this first.
I first noticed this when I started using Ubuntu instead of Windows XP. I wanted to see what Ubuntu was like so I set it up so I could boot either Ubuntu or XP. From what I could find through testing different things the problem is not from the script, but from the .blend. I made the enter animation when I was still using XP and the exit animation when I started using Ubuntu. Both times I used Blender 2.57.1, the only difference being the operating system. The same error occurs on both systems and with earlier versions of Blender 2.5.
Could someone help with this? I’d attach the game, but it’s not one .blend file, it’s multiple files linked into one level and I don’t think I can upload that.