How to make a skill where my character goes invisible to enemies eye's and awso should ignore they're collisions ?

I have the skill where my character can go invisible which is ready but enemies can still see the character i want him to be able to not only be hidden from the enemies but awso to be able to go like a ghost through them for the duration of the skill is active. I use Set collision node but i dont know what collision settings should i set up on it and the enemies…i tested random a lot of settings but cant find the right one I either fall through the floor or it is not working to go through enemies and they block me…

Would be nice if someone knows a solution to this

If you are using AI Sight for your enemies to see your pawn, then you might be able to Unregister your pawn from the Sight sense for this duration by adding an AI Perception Stimuli Source Component to your pawn and calling Unregister From Sense/Register For Sense

There is a slight chance this won’t work if you have automatic registration of all pawns enabled (which is by default), I haven’t tried. But if it doesn’t work, then you should add

[/Script/AIModule.AISense_Sight]
bAutoRegisterAllPawnsAsSources=false

in your DefaultEngine.ini config file. If you do that, you will have to manually add AI Perception Stimuli Source Components to all you pawn classes that should act as stimuli sources, and configure the senses for which they should be enabled. After that, you should be able to register and unregister using those components as you please.

Regarding the collision, you could use SetCollisionResponseToChannel on your pawn’s components, and set the response to Pawn to be Ignore while your skill is active, and block otherwise (if that’s your design)

Awsome i think thats the node i was looking for but for some reason it is not working as it is now

Did i set it up correcty like this ?

Yeah ti seems correct, does your enemy pawn have other components attached that are perhaps another type that is blocked by your pawn components? For example does your enemy pawn have any colliding components that are of type WorldStatic/WorldDynamic by any chance? Because these are blocked by default

1 Like

No extra components only the collision settings in the details panel…
This are all on all my enemies

should the collision node not bypass this ?

my player character has this

Do i need to change any of those settings ?

Edit: found it i needed to ignore physics body instead of pawn or both works now thx. I will try tommorow the rest thx again for the help

How did you acctually make that when you go through the characters your third person camera stays the same and is not moving like when you go in some corner and there is a wall next to you and when you rotate the camera it adjust to the wall that is blocking the view to how would normally rotate around the character if no obstacle was there…Don’t know how to explain it but when i go invisible and i try to go through the enemy my camera aways changes when im passing them and adjust and get back to normal… Any idea how to fix it so i can get the same result as in your video ?

I tried to set this up but didnt help

I made all colliding components of the pawns ignore the camera trace channel
I always do this, I’m not sure why it’s blocked by default

how can i set this too ?

i just found out this has something to do too with this

i could deactive it but then i can see through walls if i do

I have camera collision set to ignored on my enemies but it still doesnt work :frowning:

There must be some component that is blocking the camera channel, could be on your pawn, or if you have anything attached to the pawn at runtime maybe that has components that block it

yea i just found it the capsule component had another collision settings then the mesh which was on ragdoll profile so there was the camera not ignored and now it works :smile:

Hey man im revisiting this as the last time i acctually didnt finish it.
As of now i can go through enemies as a ghost so to say but i am trying to make him real invisible so enemy’s dont see him at all. For now they do attack me when im close to them and they see me in this ghost form…

Anyway i tried to add the AI Perception stimuli source component and then on my skill i added the Unregister from sense but its not working. I awso changed the DefaultEngine.ini and added
[/Script/AIModule.AISense_Sight]
bAutoRegisterAllPawnsAsSources=false

So far it doesnt work or did i miss something ? Here is how it looks like right now
https://streamable.com/ao53nz

and on the skill where i put the unregister from sense

I hope that there is some simple fix for this or maybe i just overlook something somewhere ?

I try to get “see pawns” from the pawn sensing as it seems if i deactivate it directly on the enemy then the enemy is not seeing the player anymore. Unfortunatly its not working when i call this variable on my skill or maybe im setting it wrong dont know…


I’m not sure about how you’ve implemented stuff, but you will have to handle forgetting about the target if it becomes unavailable yourself. I’m not too familiar with the Pawn Sensing Component, my answer was assuming you are using AI Perception Component instead. The AI Perception Component has an event that has data about a sensed target, including if it was sensed or lost

I used only the pawn sensing but i added the AI Perception component as well just to test this. After adding the component i try to Unregister from Sense node as you mentioned but it didnt work for some reason :confused: I then awso added the 2 lines of code to the DefaultEngine.ini and still failed. Do you maybe have an idea why this aint working with the ai perception ? And any alternative to it maybe to get the same effect at the end ?
I’ve seen that puting a Cube over the character so he is in the middle of the cube and the cube setting in the collision settings “Visibility” to block seems to get me fully invisible to enemy’s but wierd enough when i remove the Cube and set the same Visibility setting on the character mesh the enemy then again can see the character… Any more ideas what i can try ?

I awso try to ignore or block the visibility on the bp but both didnt work…But that awso dont work

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.