Hello, i’m quite new to unreal and i’m making a simple game. I have to make a puzzle in which there is a central cubic pillar with riddles written on each side. In front of each side of the pillar there are smaller cubic pillars with a rotating head. In each side of the rotating head there is a word. The goal of the puzzle is to rotate the small pillars until the right word is facing the side of the central pillar. The question is: what the best course of action might be? I was thinking of checking the relative rotation of both the small pillar and the central pillar, but i know that there is a better solution. (pic for reference)
Hey GiovaneVecchio!
Hope you’re doing well. That’s actually a cool sort of puzzle. Nice job coming up with the idea.
One way that stroke my mind is to create a function in small pillars BP (GetSmallPillarState). The function checks small pillars own rotation and based on the state that is in, it will return a integer value or enum( based on your preference and experience).
Then you can create an event dispatcher that gets called every time the rotation occurs.
After that inside your central pillar BP, you can get a reference to each small pillar. Then add a listener for the dispatcher and on dispatcher event, call GetSmallPillarState func to get the return values for four of them. According to the returned values you can check if the conditions are met and achieve your desired behavior afterwards.
Let us know if you need further clarification or any kind of questions!
thanks dude, i’ll try this immediately!
If the pillars rotate 90 degrees at a time, you could get away with just comparing integers.
Well there is multiple ways to do things, like in puzzle also creating the puzzle is a puzzle for me
What I would do is actually can be quite simple rather than checking the rotations, however its your choice ofcourse.
I would place a function on correct side normal from each pillar and expect them to hit central pillar counting 4.
When 4 number of hits reached its solved.
- Function to : From Pillar to Forward Vector SingleRayCast 20m and check if hit object is centerpillar.
- raycast each pillar function when one of them is interacted.
- Check function to IsSolved
Think like its a mirror refecting laser beams