How do get a projectile to bounce against a wall?

This is a 2D game. I have an object on the right that is moving up and down constantly. From this moving object, there are projectiles that randomly spawn in 3 different directions: straight, 45° up and 45° down. The up and down projectiles are hitting the top and bottom walls and instead of bouncing they hit the wall and then just slide against the wall. The pics below show my setup of the collision model, the projectile, and the mesh. I cannot figure out where I am going wrong. How do I get my projectiles to bounce against the walls?

Thanks,

Check the First Person Template … the projectiles there bounce against objects and the wall … compare those setups to yours. It has to do with your projectile movement component that you have on the projectile … this has all the settings that includes friction, bounce, etc.

Hey ,

Qdelpeche is correct. If you look at the example given in the First Person Template, you should be able to reconstruct this blueprint for your 2dpaper project. Make sure that you’re looking over the projectile blueprint as well as the character blueprint for the controls.

If you have any further questions, please let us know. Thanks!

Thanks. I tried that but still not getting anywhere. My projectile still hits the wall and just slides against it. My projectiles are slightly different than the ball in the FPS template. That one has gravity and mine doesn’t. It is fired by a keypress and mine is spawned randomly. Also I don’t have a Projectile option in my rollout under the Collision model. I have attached an image to show this. This is so weird that I can’t get them to bounce. Any suggestions are helpful.
Thanks,

Hey ,
Projectile is not one of my options. See the image below. How do I get this? I am using UE4 v4.7.6.
Thanks!

OK. So I set up a Custom Projectile setting. However, two things: 1. The actual word Projectile still does not show up. Instead the word Custom still shows up even when I choose the Object Type as Projectile. In the FPS example the word Projectile shows up instead of Custom leading me to believe that I am missing something. See the image below. 2. Even though I completely remade my object to match the settings of the ball projectile in the FPS template game, it is actually more messed up than the one I had working. So, I am currently no better off than before. I am still baffled as to why my original setup won’t work (shown in pics above) when all I need is for the projectile to simply Bounce off the wall when I check the box for Should Bounce. Any other suggestions would be great. Thanks.

42541-projectile+custom.png

Hey ,

Have you tried setting it up with the custom label but having the settings match First Person Template? This should enable you to have the same effects as First Person Template. You can also try PhysicsActor as that’s one I’ve used recently for a projectile and it worked (including bounce), but when I used it this way I added a physical material onto it too.

Looking forward to hearing back from you!

Hey ,
Actually if you read my reply to your earlier comment I did try doing just that and it still did not work. I am not sure what is going on. Is there anyway I can send you my file to see what is wrong with it?

Hey,

I must have missed where you said you had already tried both of those suggestions. My apologies. You can definitely send me the project through a private message on the [forums][1].

Thanks! :slight_smile:

Hello,

I’ve been working within your project a bit. I’ve been able to get the demons to bounce. You need to click on the projectile movement and add the settings within the projectile section, which asks for initial speed, speed, gravity and so on. You also need to make sure you have the projectile set up to bounce, and to add friction into it.

You also need to click on ‘Sphere1’ and change the collision presets to ‘custom’ and change the object type to projectile.

Another thing that you may want to do is add in a blocking volume at the top and bottom of your screen, as it’ll create an invisible wall for them to bounce off of. I added that in too, to check that it works properly and it definitely did.

I hope these suggestions help you achieve what you’re striving for. Please let me know if I can be of any additional assistance.

Thanks!

Hey ,

I have not heard from you in quite a while. At this time, I must close your thread out as answered. However, if you’re still experiencing trouble with this specific issue, please do not hesitate to reply back to this thread and open it back up. However, if you have any other questions, you can simply post a new question to AnswerHub.

Thanks!

Hey ,

Thank you for all your help. I finally got it working right.
I had started the project in version 4.6 and then updated it to 4.7 after I had created some of the meshes and blueprints and they were causing some issues. I fixed that by deleting the blueprints and re-creating them while in 4.7.
Then I discovered that I had the Collision preset correct on the Sphere1 but not on the mesh. I had to make sure the mesh and the sphere1 were both set to the same collision setting. Then the spawned objects began to work properly.
Thanks again for your help,

You’re very welcome. I’m glad that everything worked out for you. Please let us know if you have any further questions. Good luck on your project! :slight_smile: