How to create a simple BP for an enemy to slow his movement speed down when he is going over a box collision which should trigger this ?

■■■■ it looks so cool on your presentation but i cant make it im close tough :smiley:

i dont have time right now but will try little later and report back how it went

can you tell me what variable exactly is your “Owner” one ? This is how mine looks like
but i have a feeling it is the wrong one?

1 Like

Actor is fine since we don’t need anything specific from Pawn or Character class.

Since we are doing this in an actor component, the owner is the actor that the component is added to.

This is the BP hierarchy of the character I’m using:
image

What is this “Set Stencil” function ? Just figured out the get node after it i miss this function tough and the math expression

here is how far i get just again the last 2 nodes i cant do them

here is what i could do the math expresion when i open it it say its “read only”
so afcourse this is still not working and i cant belive that is so hard to finish this last 2-3 steps requiered… instead of the Stencil function whatever it is i could only make a SET one and its not working the math expression is wrong so it does nothing

here is the math expression is read only for some reason

hey man can you later point me out how i could finish this ? Would be greatly appreciated for the help. I’m revisiting this trap scince weeks and i couldnt make it work till now i hope with the last steps that are requeired that this can finally start to work ty

Its a custom function made to turn the character blue. You can ignore it (forgot to delete it).

Math Expressions are worth digging into. It will save you a lot of space and ease the math visually. You can even type the name of the variable and it will automatically add it.
Here are some links:


Delete this:


Makes no sense to give it the value it already has.

That Note should be saying that the cast should always pass since you are getting the CharacterMovementComponent and casting to it aswell.


You could save yourself that cast and assign value directly to the variable, but IMO you should still check for a null pointer (or expect it to eventually crash if owner doesn’t have one). Changing the cast to a IsValid should serve the same purpose. There is no harm leaving it as is at least until you get it all working.

Just be patient and keep at it. Feel free to post if you need anything.

I was a couple of days offline but i just came back. I’m not sure what happend now but this is no more working at all on the enemy’s like the whole logic is not apply anymore is like if i had changed something. I finished the math expression and pretty much everything looks exactly the same as in your screenshots. Any idea what went wrong and why it is still not working ? i removed the math expression and just apply a simple “subtract” node to test how it was back then where it worked partialy so subtracting some of the movement speed so this logic still had any effect even if it didnt work correctly as i wanted but now for some reason it dont do anything anymore (with math expression or swicthing it back to just simple subtract node)
so here its the exact same 1:1 just like from your screenshots with the math expression

Can you tell me what im doing wrong with it ? i really just want to make it work nothing more and i try so hard for weeks and failed for some reason and i dont see any difference between your logic and mine. Now the whole thing do not apply at all anymore to an enemy when they go over the trap is like it wasnt there. i had the component added to all the enemy’s and the trap itself if this is even needed there
this is the component added on the enemy i want to slow down and i dont know why it does not do anything anymore previosly with the subtract node at least it slowed them but stacked after going from the first trap to the next but now it has no effect at all
bandicam 2023-03-21 22-18-37-258

Here it is once more without the “set” nodes you mentioned that i dont need them but the whole thing has no effect at all on the enemys walking over the trap