Hi. I want that when a user enters a combinations of keys something that has physics will drop from the sky. Can you please suggest how to do it? I don’t really know how to summon objects either
Sorry for noob questions, I watched a lot of tutorials prior asking, I just can’t figure things out on my own.
This is bad… This is very, very bad… But what about summoning objects on just let’s say a key?I know how to bind events on keys, but I don’t know how to summon, not a great mage yet, please halp
There are 2 different things here - capturing the exact keys in order and summoning an object. I’ll help you with the summon:
Summoning is nothing more than Spawning An Actor From Class at a specific location. Simple steps:
So for now, create a new input key and call it “Summon”
Inside your character blueprint grab the Summon Event and from there type “Spawn Actor from Class.” Specify the class you want to spawn (this is the blueprint that will appear in the sky).
Then drag from Transform and select Create Transform
Then type Get Actor Location. From the node drag and type ‘+’ and get Add Vector. Add a large number to the Z value (height in the sky relative to the Player’s position). Then connect this to the Location of the Transform.
Use Get Actor Rotation and connect this to Rotation inside the transform
Make scale 1,1,1.
Inside your blueprint that will be summoned, make sure you enable Gravity and Simulate Physics.
Now when you Press ‘Summon’ your blueprint will spawn on top of the Player and will fall with gravity.
Hi man!! Thank you very much for this great tutorial!!! Very appreciated! I encountered a problem can you please look? Whenever I drag “Create transfrom” from “spawn transform” I don’t see a “creater transform option”
Do you also know why it spawns only in a some place regardless of my rotation? Like, wherever i turn my character - class will only spawn in the same place
Glad it worked out! I think you mean that when you rotate the Burgclass doesnt spawn 1000 units infront of the player? (Since you have X=1000). Thats because thats the world position, and not the relative position. If you want the spawn to always be 1000 units infront of the player, then you need to do the following:
Get Actor Forward Vector and multiply it by 1000, then Break Vector (right click on the out pin and click on break). Then Plug the X and Y into Make Transform and leave Z to 1000