Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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

Product Version: UE 4.18
more ▼

asked Dec 07 '17 at 11:11 AM in Blueprint Scripting

avatar image

1 1 2

(comments are locked)
10|2000 characters needed characters left

2 answers: sort voted first

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.

more ▼

answered Dec 07 '17 at 11:30 AM

avatar image

710 7 15 18

avatar image Muthar Dec 07 '17 at 06:02 PM

hey see when i put spawn actors of class to spawn spawn pointbp what should i put in for spawn transform

avatar image aNorthStar Dec 07 '17 at 06:06 PM

this is where you specify the world location (and optionally, transform and scale)... Use Get Actor Location location to get your spawn point's own world location

avatar image aNorthStar Dec 07 '17 at 06:07 PM

or use Get Actor Transform...

avatar image Muthar Dec 10 '17 at 02:13 PM

this is what i have in spawnpointBP, and when in MyBallBP i made static mesh and in that i made an sphere but this still doesn't work alt text alt text

untitled2.jpg (270.3 kB)
untitled.jpg (71.2 kB)
avatar image Everynone Dec 10 '17 at 09:04 PM

Actors do not receive input by default. You may need to enable it for the player in that blueprint's Class Defaults.

(comments are locked)
10|2000 characters needed characters left

Like this?


Create a boat actor. Create a ball actor. Click on boat > spawn ball:

alt text

capture.png (84.2 kB)
more ▼

answered Dec 07 '17 at 11:32 AM

avatar image

11k 68 22 45

avatar image Muthar Dec 07 '17 at 11:57 AM

yeah like that

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question