Hello. Im looking for a way to set the projectile (a rocket, from a rocket launcher that spawns “explosion” actor on hit, adds force etc) to ignore the player mesh? It collides with my player and explodes instantly when my character is moving. I tried to spawn the projectile far from the barrel of the gun, but this doesnt make it feel any better - as it generates its own issues. Basically, i have a parent class for weapon, where i spawn different types of projectiles dependant on booleans (ex. i have a boolean called hitscan, if its true, the linetrace will be spawned. or Rocket, so when its true, i will shoot only “Rocket” projectiles, that when they hit spawn an actor called Explosion, with particle event and explosion force) - long story short, im going nuts because i have no idea how i can set it to not explode on player, but rather on any other object it hits. How can i achieve that? Below i will post my character blueprint. Thanks for help in advance.
Post the blueprint of your projectile
Can’t you just set the projectile’s collision to ignore pawn?
I still cant seem to find any answer, and its getting tough to find anything else. None of “ignore actor when moving” seems to be working as intended, and collision presets are not a good way too since i want rockets to actually hit enemies… Does anyone have any other answer how can i actually ignore ONLY player’s mesh, as i cant seem to find any…
I tried to do this, but i have no idea yet how i can achieve this effect… I mean i can see that i can set collision preset and object channel. Do i create a object channel for the player, and then a preset for rocket where i set it to ignore player, and everything else is set to default? Which options should i pick when creating a preset for rocket (ex. world static, world dynamic etc) and moreover: should the object channel for player be set to ignore, block or overlap? Im sorry, im an absolute newbie to creating mechanics like that and to UE4 at all, so i still dont really get how things work out there… And thanks for help
Two options: 1. Set different collision presets to the player and the enemies (you can create your custom collision channels in project settings). 2. Disable collision for a second, and reenable it mid-flight.
The first one would be preferable since you won’t have to deal with delays or timers.
For the projectile, just pick one that you don’t use for anything else. PhysicsBody for instance. Set it to ignore pawn. For the enemies, set another channel, not pawn, that blocks the projectile and is blocked by the projectile. You can create a custom object channel in Project Settings => Collision.
Imgur: The magic of the Internet this is what i did. Works for now, im not yet sure about the enemies as i didnt make them yet. I have one more question - for enemies im making a new channel set to “block” as a basic response. Then i create a preset for enemies, that blocks the projectile and set the projectile to block enemies? Did i get that right? Big thank you for your help and responses.
Yes, that’s right. Just place a cube onto the level and set its collision to Enemy and test it. That should work just fine.
P.S. Better set the rocket to ignore camera and visibility too.
Thank you so much.