x

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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Custom collision object channel for pawns breaks character blueprint?

Hello,

I am trying to create a projectile system where when the player fires the projectile it ignores him and does not generate any overlap or block events but when it hits the enemy it generates an overlap event and destroys itself. The problem I am facing is, how do I get projectile to ignore the player pawn? I thought I would solve this by creating a new collision object channel called "Player Pawn" and setting the capsule collider's (in the player character blueprint) collision object type to the newly created "Player Pawn". This Player Pawn would ignore projectiles. However when I do this, my character blueprint stops spawning correctly (There is no mesh present, the camera is locked looking donw negative y axis at (0,0,0).). The object responses are setup exactly the same way as it would be for "Pawn". Where am I going wrong here? Is this even the right way to approach the problem? Is this broken/a bug? I am not sure where to begin.

Cheers

Product Version: Not Selected
Tags:
more ▼

asked May 18 '14 at 09:12 PM in Using UE4

avatar image

HypnoticShark
617 23 29 47

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

2 answers: sort voted first

instead of making the collision system filter your enemies, why not handle that in the projectiles blueprint?

you could make it overlap any characters and test if the character is the right kind of pawn before blowing up.

to test the type of pawn, use a cast: drag off an object variable onto a blueprint and type "cast to" and find the type of object you want to check against.

more ▼

answered May 20 '14 at 12:03 AM

avatar image

ScottSpadea
9.6k 320 205 449

avatar image HypnoticShark May 20 '14 at 04:38 PM

I did not want to do that because If I have many enemies in the future I thought I would have to check against all of them. Please do correct me If I am wrong here. I wanted the system to just be setup once and "just work". I solved the issue by creating separate collision channels for player projectiles and enemy projectiles. The enemy pawns would ignore collision of the enemy projectile and generate overlap events for the player projectile and the same principle applies to the player projectile.

avatar image ScottSpadea May 27 '14 at 05:30 AM

in object oriented programming, any common functionality that you want between different objects can be achieved by inheriting from a common parent class. so you could make a base class for all of your vehicles and characters that contains a variable like "teamID" that is checked when they are hit.

if the projectile's parent's teamID is different from the victim's teamID, victim takes damage. otherwise, check if bFriendlyFire is true, and if it is, victim takes damage, otherwise, victim tells teammate to watch their aim.

another way to have common functionality is by separating that functionality into a separate component. so you could create a DamageDealingComponent object that all of your enemies add as a variable. that component could contain teamID, friendly fire logic, status affect mixing logic, etc... this component paradigm is nice because it makes it easier to make some enemies own multiple health bars just by adding more damageDealingComponents.

avatar image HypnoticShark May 27 '14 at 05:37 PM

Thanks Omnicypher! Looks like I am going to go ahead and do that and restructure my projectile blueprints (I have only 2 at the moment and both are the same really). That way makes much more sense haha.

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

I had a similar problem when I created a new collision channel and object channel. The problem is that when you create these new channels they get set on every object in your game, usually to something like Block or Overlap.

You may need to at least go into your character and/or all the other actors in your game and properly set how they should handle the new trace/object channel.

Then restart the editor. This at least fixed my problem, hopefully yours as well.

more ▼

answered May 27 '14 at 09:38 AM

avatar image

Zeustiak
1.8k 131 68 110

avatar image HypnoticShark May 27 '14 at 05:39 PM

Hey Zeustiak, I tried doing that but it would still break my character blueprint and my camera would spawn at (0,0,0) and point down the X axis. I also made sure it had the same properties collision as a pawn and everything else in the world treated it the same way as it handled a pawn.

(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