trggerBoxにオーバーラップした状態で右クリックを押すたびにランダムに弾が発射される装置を作ろうとしております。
弾にはそれぞれ「projectileMovement」を設定しており、それをtriggerBoxでスポーンさせようとしています。
Gateを使うなどして、2つの信号が入力されたら出力するように試したみたのですが上手くいかず・・
UnrealEngineは初心者なので、かなり初歩的な内容かもしれませんが、知恵をお貸しいただけると嬉しいです!
Hi @Tom.UE. (I do not speak Japanese, but I translated your post to English; there may be some errors in the translation so please correct me if I’m misunderstanding the issue)
So basically your trying to spawn a random bullet if you click the right mouse button and while your are overlapping a Tigger box, correct?
(I’m not sure how you system is setup so this solution may be irrelevant to you and if it is please provide more information/images)
First you want to make a boolean variable to tell whether or not the player is overlapping the Trigger box. You want to make this boolean variable inside your player blueprint and make sure the default value is false.
(You may have a different name) (These images are examples)
You already have an “Actor Begin Overlap” event and this event has an output named “Other Actor” and this will give you the actor that is overlapping the trigger box. So you would need to check if the player is overlapping the trigger box. By using the “Other Actor” you can cast to your Player Blueprint.
(You may have a different name and ignore the other pins, you may not have them) (These images are examples)
If the cast is successful, then that means the player is overlapping the Trigger Box. If the cast is successful then you want to use the boolean variable inside your player blueprint and set it to true.
(You may have a different name)(These images are examples)
To determine if the player has left the trigger box you can use the “End Overlap” node.
(You may have a different name) (These images are examples)
Cast to the player using the “Other Actor”, but this time if the cast the successful you want to set the boolean variable to false:
(You may have a different name) (These images are examples)
Now inside your Player Blueprint, you want to have a branch node after your Right Mouse Button Pressed Event. The condition will be the boolean variable your made.
(You may have a different name) (These images are examples)
Off of the true node, you will spawn your bullets. I recommend using a Class array and placing all of you different bullets inside the array and use a random node to get a random bullet and spawn it.
Example:
You can also use the random node:

Hope this helps and please let me know if there is any confusion or if I misunderstood the question.
Hello, @ArcReed3215.
Thank you for your reply.
I am surprised to hear back from someone overseas.
I read your reply.
However, due to my lack of knowledge, I did not understand it properly.
I apologize for that.
I think my question was not clear enough.
So I will try to simplify my question a little more.
What kind of blueprint should I use so that when the left mouse button is pressed while the “Actor” is Overlapped on the “TriggerBox”, it prints “print String”?
Thank you in advance for your answer.
Hi @Tom.UE, thanks for clarifying!
You would need need an “Actor” blueprint, this blueprint will be the player.
You would also need to use the “Level” blueprint, this blueprint is built in and is associated with your level. The “Level” blueprint will allow you to check if the player is overlapping the “TriggerBox”.
The “Level” blueprint can be found on the top left of the window, under the “Blueprints” dropdown:
You want to select your “TriggerBox” inside your level: This is indicated by the blue highlight
Open your “Level” blueprint and you will be able to find the “Add On Actor Begin Overlap”:
Yellow Arrow: “Level” blueprint (It should have the same name as the map)
Red Arrow: It says “TriggerBox” meaning I selected the “TiggerBox” inside the map
Blue Arrow: Overlap Event for the “TriggerBox”
There will be more steps, but I don’t want to overwhelm you so let me know if your able to get to this point. If you have any questions let me know then we can continue on with the rest.
ArcReed3215
Thank you for your kind reply.
I see, I needed a “level blueprint”.
Thanks to you, I was able to understand to the points you mentioned.
Regarding this question, I tried many things based on the tips you gave me and solved the problem.
I was able to get it to work by using the event dispatcher, event dispatcher, and custom events in the level blueprint.
Thank you very much for taking the trouble to translate and answer my question.
I appreciate it.
@Tom.UE, great to hear that things are working. I’m glad I was able to help, best of luck!