I'm trying to have the player buy an item from the shop within a conversation, but the method isn't being called at all (no Debug.Log being shown)
But it works when I want it to spawn coins, using this:
SendMessage(SpawnMyCoins,,Tarul);
{{defaultsequence}}
But when I do the same thing for adding items,
SendMessage(AddSmallPot,,Inventory);
{{defaultsequence}}
Nothing happens. The only code I have in "void AddSmallPot" is the Debug.Log, that's not showing up.
Suddenly it says "Unrecognized shortcut, defaultsequence", and when I remove defaultsequence, it says nothing but doesn't work.
I tried to register it as a Lua but it's been too confusing and I don't know what to write and where to put it.
Any help is greatly appreciated, all I want to do is call the method from my inventory script
Calling Method From Sequence; Not Working
-
- Posts: 60
- Joined: Thu Mar 24, 2022 12:07 am
Re: Calling Method From Sequence; Not Working
Hi,
Try:
The special keyword is {{default}}, not {{defaultsequence}}.
Also make sure only one GameObject is named "Inventory" and that it has the script with the AddSmallPot() method.
If that's not possible, you could register a Lua function instead, or hook up a scene event. (One caveat with scene events: you can't export or import from other sources such as articy:draft because scene events are Unity-specific.)
Try:
Code: Select all
SendMessage(AddSmallPot,,Inventory);
{{default}}
Also make sure only one GameObject is named "Inventory" and that it has the script with the AddSmallPot() method.
If that's not possible, you could register a Lua function instead, or hook up a scene event. (One caveat with scene events: you can't export or import from other sources such as articy:draft because scene events are Unity-specific.)
-
- Posts: 60
- Joined: Thu Mar 24, 2022 12:07 am
Re: Calling Method From Sequence; Not Working
Ah, got it thank you, it's working nowTony Li wrote: ↑Wed Nov 09, 2022 9:52 pm Hi,
Try:
The special keyword is {{default}}, not {{defaultsequence}}.Code: Select all
SendMessage(AddSmallPot,,Inventory); {{default}}
Also make sure only one GameObject is named "Inventory" and that it has the script with the AddSmallPot() method.
If that's not possible, you could register a Lua function instead, or hook up a scene event. (One caveat with scene events: you can't export or import from other sources such as articy:draft because scene events are Unity-specific.)
Re: Calling Method From Sequence; Not Working
Glad I could help!