how do you add objects with press of button or click of mouse
Hi i am trying to make an game in which when the player press a button or clicks a ball is added. like when the game starts the user will click or press space bar and ball should be added to the boat, like on top and it will fall in the boat and the player can add as many ball as he or she like, but what i tried to do was make the ball visible and when the player press space bar it makes the ball visible but that don't work either
asked Dec 07 '17 at 11:11 AM in Blueprint Scripting
this is fairly straightforward...
using your boat and ball as an example:
SpawnPointBP - set up your own actor BP, using a blank/dummy scene component... maybe call it SpawnPointBP. In the event graph, use the Spawn Actors of Class to spawn MyBallBP actors... you can run this off Tick, using a looped delay to slow down the spawn rate... otherwise you'll fill your boat up instantly. Or use a keypress to trigger spawning
MyBall BP - set up another actor BP, MyBallBP, with a static mesh component (a ball) and collision component (a ball shaped collider)... set up its physics so it collides with the world and bounces around appropriately
Finally, drop SpawnPointBP into the scene at the location where you'd like your objects to drop from.
Follow this question
Once you sign in you will be able to subscribe for any updates here