Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: KillerCreeper on May 06, 2019, 09:35:31 PM
-
I am creating an inventory system and working on swapping items at the moment. I've got it to get the two item variables of each of the slots that are getting swapped and switching their variables with each other. It works the first time, then, the second time, it doesn't. Then, if you try it a third time, it works and it keeps going in this loop. I've looked very thoroughly into this and it is getting the right variables each and every time. It's literally like PlayMaker just doesn't want to use the set variable actions every second time.
Is this a bug with PlayMaker or is there something wrong with how I've put this together?
-
Hey there,
I'd guess you got something set up wrong with the states/order of events. I can't quite tell from the pictures what the issue is without seeing the states and how they flow.
Are you able to post the state machine you think is causing the issue as well as the action in them?
-
Hey there,
I'd guess you got something set up wrong with the states/order of events. I can't quite tell from the pictures what the issue is without seeing the states and how they flow.
Are you able to post the state machine you think is causing the issue as well as the action in them?
Okay. This FSM is on the Image(or Item) that is a child of the inventory slot, which is a prefab.
I believe that it is State 4 on the FSM that is causing the problem but I want to also post how State 8 works because they work together.
State 8 gets the parents of the item that was dropped(itemParent2) and the item that itemParent2 was dropped on to(itemParent). Then it sets their parent to the opposite of each and switches their position, that all works fine. State 4 is getting the Item variable from itemParent and itemParent2 and simply switches their variable values. Which, it works, but it doesn't work consistently, which is what I stated before.
-
Hey there,
I'd guess you got something set up wrong with the states/order of events. I can't quite tell from the pictures what the issue is without seeing the states and how they flow.
Are you able to post the state machine you think is causing the issue as well as the action in them?
Also, here is the whole FSM if that is needed. Don't mind the swapEmptySlot transition and State 3 and 11. They do exactly what State 8 and 4 do and nothing activates the transition. It's purely for testing at the moment. The dropItem transition doesn't activate by anything as well.
-
Hey there,
So first off those var names are really hard to follow along without getting confused lol.
Second I believe this is the source of your problem. Need to use a variable as the parent for those 2 objects will turn out to be the same every other time which is the result you're getting.
If that wasn't the fix let me know and I'll look a bit closer once I leave work :P
-
Hey there,
So first off those var names are really hard to follow along without getting confused lol.
Second I believe this is the source of your problem. Need to use a variable as the parent for those 2 objects will turn out to be the same every other time which is the result you're getting.
If that wasn't the fix let me know and I'll look a bit closer once I leave work :P
The get and set parent actions are working correctly each time. It's the fourth state that is problematic, the set variables actions. It's getting the game objects correctly every single time, but it's just not setting them the second time, for some reason.
-
Hey there,
So first off those var names are really hard to follow along without getting confused lol.
Second I believe this is the source of your problem. Need to use a variable as the parent for those 2 objects will turn out to be the same every other time which is the result you're getting.
If that wasn't the fix let me know and I'll look a bit closer once I leave work :P
This is a good example of what I mean.
-
I've tried so many things and nothing has been working...
-
I'll see if I can repro here. You don't happen to have a repro project you could email me?
-
I'll see if I can repro here. You don't happen to have a repro project you could email me?
I don't... But I can give you the exact, full fsm actions and state. Unless you mean if I can just copy my project and send it to you?
-
Either would be good. Can you send to my email. Thanks!
-
Either would be good. Can you send to my email. Thanks!
How exactly do I get your email? If I try to email you from the forums, I don't get any attach file options.
-
I'm starting to think this is a bug or something with PlayMaker. I think there is a bug with getting or setting fsm varialbes, or both.
-
Hi.
If you press on the e-mail icon you get the email page.
From there copy paste the e-mail address to the email service that you are using.
For a complete project you can use something like WeTransfer (https://wetransfer.com/)
If you do so you should zip or rar your project and add a password to it.
Then mail the link to Alex (with the password).
-
hi.
Maybe you make a scene with some standard object, with the same setup and see if the issue is still there.
if so you can share the scene here, so i can have a look as well
-
hi.
Maybe you make a scene with some standard object, with the same setup and see if the issue is still there.
if so you can share the scene here, so i can have a look as well
Here it is. Press F while hovering over an item with your cursor. Then try swapping items and look at the Item variable on the InvSlot prefabs in the inspector.
-
Thanks for the test scene. I’ll take a look...