• Hi Guest!

    This is a notice regarding recent upgrades to the Hub. Over the last month, we have added several new features to improve your experience.
    You can check out the details in our official announcement!

how to click a button/UIButton or trigger a trigger in a plugin?

wjslsyx

New member
Messages
3
Reactions
0
Points
1
Twitter
1234321
hello, how to click a button/UIButton or trigger the trigger in a script, so that some animations can be added to a sequence? here is what they are like in the scene file:

{
"id" : "Button",
"on" : "true",
"type" : "Button",
"storables" : [
{
"id" : "Trigger",
"trigger" : {
"displayName" : "77",
"startActions" : [
{
"name" : "77",
"receiverAtom" : "Person",
"receiver" : "AnimationControl",
"receiverTargetName" : "AddAnimationToSequence",
"stringChooserActionChoice" : "Catwalk Heels - Twist R to Twist L"
}
],
"transitionActions" : [
],
"endActions" : [
]
}
}
]
},
{
"id" : "UIButton",
"on" : "true",
"type" : "UIButton",
"storables" : [
{
"id" : "Trigger",
"trigger" : {
"displayName" : "A_AddAnimationToSequence",
"startActions" : [
{
"name" : "A_AddAnimationToSequence",
"receiverAtom" : "Person",
"receiver" : "AnimationControl",
"receiverTargetName" : "AddAnimationToSequence",
"stringChooserActionChoice" : "Catwalk Heels - Twist L To Idle"
}
],
"transitionActions" : [
],
"endActions" : [
]
}
}
]
}
 
the formatted text
Untitled.png
 
You can add formatted text with a code block:
JSON:
{
    "key": "value"
}

1713036735261.png


hello, how to click a button/UIButton or trigger the trigger in a script, so that some animations can be added to a sequence?

Assuming your script is on the person atom

C#:
var animationControl = containingAtom.GetStorableByID("AnimationControl");
var stringChooserAction = animationControl.GetStringChooserAction("AddAnimationToSequence");
stringChooserAction.actionCallback("Catwalk Heels - Twist R to Twist L");

I highly recommend checking out the official discord's #scripting channel, specifically these getting started tips: https://discord.com/channels/363274293112602636/505398213675581453/1095986301314007080
 
You can add formatted text with a code block:
JSON:
{
    "key": "value"
}

View attachment 355520



Assuming your script is on the person atom

C#:
var animationControl = containingAtom.GetStorableByID("AnimationControl");
var stringChooserAction = animationControl.GetStringChooserAction("AddAnimationToSequence");
stringChooserAction.actionCallback("Catwalk Heels - Twist R to Twist L");

I highly recommend checking out the official discord's #scripting channel, specifically these getting started tips: https://discord.com/channels/363274293112602636/505398213675581453/1095986301314007080
Thank you very much for your help. I'll make sure to check the channel.
 
Back
Top Bottom