1
$\begingroup$

I am very new at coding and I am doing a school project in Blender. I have a character created and some animations (walk, stand) done. I have a program that moves the character and now I want to make the animations play while I control it.

I have four if statements (if pressing W go forward and all that) and that works. I am trying now to make the “standing” animation play while NONE of the keys are pressed, so I put it in the “else” statement. The armature has an Action actuator in the logic bricks, an I called it with python like this:

else:
    actani.action = “ARMATUREAction.002”
    actani.frameStart = 1.0
    actani.frameEnd = 70
    actani.blendIn = 5
    actani.mode = 4
    actani.priority = 1
    co.activate = (“animacion”)

But when I run it it doesn’t work and it tells me this error:

Attribute error: “SCA_PythonController” object attribute “activate” is read-only

I have been looking for a solution but I found nothing. Could somebody help please?

$\endgroup$
  • $\begingroup$ Hi, welcome to the site! I don't know much about the BGE, unfortunately, but hopefully someone else can help you. I edited your question to improve the formatting -- Markdown can be a little tricky. (: If you don't agree with any change I made, please let me know! $\endgroup$ – SilverWolf Oct 27 '18 at 21:05
  • $\begingroup$ activate is a function that you call, not a property that you assign a value to. Have a look at the example here. $\endgroup$ – sambler Oct 28 '18 at 0:20
  • $\begingroup$ @SilverWolf Everythi g is fine, thank you so much!!!!! This community is so kind!!! $\endgroup$ – Maria Pfpfpf Oct 29 '18 at 12:19
  • $\begingroup$ @sambler Thank you very much!! I'll try to make It work and I'll post if I make It :) $\endgroup$ – Maria Pfpfpf Oct 29 '18 at 12:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.