I am trying to do a shell game where 3 cups go down and move randomly so one of them can hide the ball inside. But I don’t have any reference point to start or learn from it. Can you guys recommend me anything if you have some source of info? I am trying to implement the route one using spline or something but I don’t think it will work. Thank you in advance.
I haven’t used this personally but it seems like it could be a good starting off point:
Thanks a lot. Will check it out.
won’t help
No idea guys? :C
Hey @vnr!
While I could not find an exact source, we can break it down into its elements. So what you are going likely going to need is:
- 3 predefined locations for your cups to move to.
- More than likely 6 splines for your cups to move along (over and under)
- 3 cups and a ball all together in a single blueprint.
- A randomizer to choose which two cups are moving and how they are moving.
Can you share some more specifics on what part’s you are having difficulty implementing? Breaking down and solving those elements will help get you on the right path or completely solve the issue.
Any additional specifics you provide may go a long way in solving your problem!
Thank you so much. This is similar to what I have in mind but better. I am trying to learn ue5 on the go so all of the steps are a challenge to me which I will overcome ofc.
For the steps
1- Do I need to use location collision in the blueprints or on the map?
2- Splines are what I tried to use. But I couldn’t implement it perfectly. I did one which loops. Pretty much useless. why over and under?
3- I tried to seperate them.
4 - Randomizer is what I had in mind but Idk how to apply.
So If use 6 splines that I determined how am I gonna use cups that are in the same bp? Won’t all the cups follow the same path?
Hey @vnr,
So if we break down the cup game (IRL) into its base elements, we can get to the heart of each of these. Keep in mind this is just a game plan and not fully tested implementation yet but:
1: Because we need to prioritize the movement of the cups and ball over everything else, I would not use collision. In face, I would just keep the ball attached to the cup it its parented to.
2: The 3 cup shell game only has 3 possible movement paths that we can refer to as Outer (O), Inner Left (IL) and Inner Right (IR). So far that has 3 loops. But, having 3 loops only complicates things. 1 cup always has to start from the middle of the loop no matter what the scenario. Even worse, what if you want to do a fake out and have it move back half way through. So if we break down those splines we get 6 possible paths, Outer Up (OU), Outer Down (OD), ILU, ILD, IRU, IRD. With that broken down logic, we can have a beginning and and end to a path no matter which path it needs to take, and can assign those paths as needed to the cups.
3: You may need to make new splines.
4: So keeping in mind the above, what I would suggest generating random numbers to decide the following steps. First, which pair path are you using, O, IL, or IR. That will also select your cups in position A, B, and C. Then decide the path of the leftmost cup and assign that movement path (up or down) and the opposite to the other paired cup. Bonus points if you also add a fake out that uses a point somewhere in the middle of the spline and decide that via random chance as well.
Your change in location should apply to the cups inside of the BP, rather than the BP as a whole.
After your movement is complete, you will also need to update variables on each cup letting the blueprint know which position they are in, A, B, or C.
I know this is a lot, but does this make the logic and process you need to take a bit more clear?
Thank you so much. Yes it does. I will try to implement it and be back when I get the chance. You are the best.
I think it is a start
I will give it a try. Thanks mate.
ffff. Idk what I am doing wrong but mine doesn’t work. Which step might I missing or doing it wrong?
Your nodes are not connected to anything.
can you eleborate pls?
oh I will check and figure out where to connect hopefully thank you so much
lol still not working
lol
@Mars007 gave you a good idea, your job is now to understand how it works and implement it the way you need it. And if you must copy it node by node, consider paying closer attention to what’s going on. Your transform rules are not correct, for example. We also do not know what’s in your timeline.