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"

Items Jumping Out of Chest

Hello. In my game; when player opens a chest, I want random items jump out of that chest and don't collide. Like in Fortnite of Epic Games.

What would be the best way to do it? With a projectile movement maybe? Though I don't know how to do that.

Thanks in advance.

Product Version: UE 4.17
more ▼

asked Oct 09 '17 at 01:46 AM in Blueprint Scripting

avatar image

127 26 31 38

avatar image w0hoho Oct 10 '17 at 07:28 PM

Does anyone know?

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

I would use Add Impulse to launch them: https://docs.unrealengine.com/latest/INT/BlueprintAPI/Pawn/Components/CharacterMovement/AddImpulse/index.html

Then use three Random Float in Ranges to generate some vectors with x and y between like -0.25 and 0.25 with a Z of 1.0. This will shoot them up at angles near but not exactly vertical: https://docs.unrealengine.com/latest/INT/BlueprintAPI/Math/Random/RandomFloatinRange/index.html

alt text

The Launch Multiplier is just an easy to control how high your loot launches.

Then create a new collision profile and channel so the loot only collides with the ground (WorldStatic) or whatever. https://docs.unrealengine.com/latest/INT/Engine/Physics/Collision/HowTo/AddCustomCollisionType/index.html

Depending on what you're going for, Set Velocity could be used in place of Add Impulse, or you could set up a level sequence that controls their bounce more precisely. But Add Impulse sounds like the best fit from what you said above.

addimpulse.png (88.7 kB)
more ▼

answered Oct 11 '17 at 01:30 AM

avatar image

151 4 10 11

avatar image Ecnassianer Oct 11 '17 at 01:31 AM

I'd only make them projectiles if I wanted to do something crazy with them, like have them bounce around the room or seek out specific targets.

avatar image w0hoho Oct 12 '17 at 02:55 AM

This works. Thank you for the detailed answer!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
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