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"

Ball in a ball collision?

Hi guys basically i have a sphere with no physics and has a glass material on so i can see inside. I want to place some much smaller spheres inside with physics on so the big balls hold the smaller balls. kind of like one of the ping pong ball or bubble gum dispensers. Any help?

Product Version: UE 4.12
more ▼

asked Jul 24 '16 at 08:12 PM in Using UE4

avatar image

21 15 16 20

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

1 answer: sort voted first

You have to make sure that the collision wraps the inside and outside of the mesh. I usually use an external tool like blender to achieve this. In your case I would make two halves with collision attached and then put them together in unreal. When that is done, just drag and drop the smaller spheres inside the large one. You can manually set the physics of each ball.

more ▼

answered Jul 25 '16 at 12:56 AM

avatar image

2.7k 106 34 177

avatar image Pantlessnoodle Jul 25 '16 at 10:32 AM

awesome thanks for the reply! gonna go give this a shot!

avatar image Pantlessnoodle Jul 25 '16 at 06:18 PM

so i cut a capsule in half and done the auto convex collision on both halves. then placed the halves together and spawned the balls inside but the physics goes nuts and they fly out :/

avatar image NoobsDeSroobs Jul 25 '16 at 06:21 PM

Check your collision in the mesh editor. Most likely the collision is shaped as a half sphere. You want it to be a hollow half sphere. You might have to recreate the collision.

avatar image Pantlessnoodle Jul 25 '16 at 06:25 PM

This is what it currently looks like on both halves

untitled.png (561.6 kB)
avatar image NoobsDeSroobs Jul 25 '16 at 06:28 PM

Try putting balls only inside one half when it is as the image shows. How do the smaller balls react?

How are you spawning them? Are you sure you are not spawning them inside each other?

avatar image Pantlessnoodle Jul 25 '16 at 06:31 PM

In simulate they are fine, work perfect. I spawn the capsule and attach it to the gun located on my character. could i be spawning it and attaching it wrong causing physics to just go mental?

avatar image NoobsDeSroobs Jul 25 '16 at 06:43 PM

So you are trying to create a gun with this? Are you moving the vessel about a lot? If so this is not strange behaviour.

I would suggest that you only use this technique for stationary things. If you want to have a gun with this thing that will move about a lot, then I would recommend creating some custom animations for it instead and make it into one actor.

avatar image Pantlessnoodle Jul 25 '16 at 06:47 PM

yeah basically a paintball gun with a capsule on top that holds the paint balls and they move with physics when the character moves. maybe thats the best option kind of sucks though :(

avatar image NoobsDeSroobs Jul 25 '16 at 06:54 PM

Yes. You can make it LOOK like it has physics by letting the animations play and then rotating the animations and mixing them to appear real. Then, when shooting spawn a ball and send it flying. Then you can remove a ball as you go or use obfuscation to make it seem like you have less.

You can also make a custom system that enables this, but I couldn't give you any step by step guide. The only thing I can say is try to make a completely covering collision shape that makes balls shooting out impossible. Maybe even teleport them back in or drag them back in if they near the edges. Then you can delete teleport them in front of your gun and send them flying.

Good luck.

avatar image Pantlessnoodle Jul 25 '16 at 07:10 PM

Thanks very much for your help! :) il keep playing around and see what happens

(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