Instead of doing GetActorOfClass, it would be better to create a Actor Reference on the door, so you can explicitly define the button that interacts with the door. That way you can use multiple of these in a single level :).
one of the issues i had was if u change the speed the door moves. from 0.2 to w.e lets say 2 seconds, if u get off the button then back on it moves the door 500 units from its current location rather than its starting position. Is there a way to avoid this
Yea, whats happening is your not leaving enough time for the block to get back to the starting location. To fix this, you might want to use a timeline with a vector curve insted of Move Component To. Timeline will let you give a start and end location. Your Open Event will plug into the Play. and Close Event will plug into Reverse. If you want to prevent the cube and the player from setting it off at the same time, this will take more work. Youll need to have a branch on begin overlap that will tell it to check if the cube has already activated it to a specific component, you could use a blueprint interface to let the button know what object is currently activating it.
In had this issue too, my solution was to set the collision of the switch to ignore the player (my logic is the player is too light to activate) and then instead of having the + node, delete it and just manually set the location of the closing 'move component to' by copy pasting the location of the door when it's closed!
Sorry, I mean as in when you make another door and button, I was wondering if I could use the exact same blueprint without editing it however, the door has its own identity so it will only open to certain buttons.
@@DDSwift Yea, the dispatchers are where its getting the identification. if you just duplicate them, both buttons will open and close 2 doors. It would be possible to add a bool that will check what door it is, maybe using the Tag system.
discord.gg/REYFMS8vTX You can drop your problem in the problem answers section of the discord channel. That way I can see your BPs and better help with the issue.
Dude I had no idea event dispatchers were that easy to implement. I came here for a simple puzzle tutorial and learned a bonus lesson!
Glad I could help man
Great tutorial. I like how you laid out your thoughts before blueprinting.
Much appreciated🙏
Tnq
Whats your program at frist of video for show laid out?
That is lucid chart
Instead of doing GetActorOfClass, it would be better to create a Actor Reference on the door, so you can explicitly define the button that interacts with the door. That way you can use multiple of these in a single level :).
I like your thinking. You would just need to define which door is which with a tag maybe.
one of the issues i had was if u change the speed the door moves. from 0.2 to w.e lets say 2 seconds, if u get off the button then back on it moves the door 500 units from its current location rather than its starting position. Is there a way to avoid this
also if the player and the cube are on the same switch it messes up the door as well
Yea, whats happening is your not leaving enough time for the block to get back to the starting location. To fix this, you might want to use a timeline with a vector curve insted of Move Component To. Timeline will let you give a start and end location. Your Open Event will plug into the Play. and Close Event will plug into Reverse. If you want to prevent the cube and the player from setting it off at the same time, this will take more work. Youll need to have a branch on begin overlap that will tell it to check if the cube has already activated it to a specific component, you could use a blueprint interface to let the button know what object is currently activating it.
@@ledthegamedev thanks for the reply. Thats exactly what I ended up doing ty ty
@@joshuahorton7936 sweet
In had this issue too, my solution was to set the collision of the switch to ignore the player (my logic is the player is too light to activate) and then instead of having the + node, delete it and just manually set the location of the closing 'move component to' by copy pasting the location of the door when it's closed!
If you dont mind, is there a way you can demonstrate not require editing the blueprint ?
what do you mean exactly?
Sorry, I mean as in when you make another door and button, I was wondering if I could use the exact same blueprint without editing it however, the door has its own identity so it will only open to certain buttons.
@@DDSwift Yea, the dispatchers are where its getting the identification. if you just duplicate them, both buttons will open and close 2 doors. It would be possible to add a bool that will check what door it is, maybe using the Tag system.
How come mine doesnt go up then come back down, it instead goes off in a random direction and stays there?
Are you getting world location and adding 500 in the Z axis?
I have the same problem, are there any fixes? I have the same code as the video
discord.gg/REYFMS8vTX
You can drop your problem in the problem answers section of the discord channel. That way I can see your BPs and better help with the issue.
not a puzzle....
Eh it's sort of a puzzle lol. We're you thinking like puzzle pieces?
😂😂😂😂😅@@ledthegamedev