Second branch not working reliably

I’m confused…

I’m fairly new to UE4 and trying to build a push system on my own with my basic knowledge, as no other tutorial really meets my needs or is unnecessary complex. Basically: It’s a 3rd person game, fixed camera view. When pressing the interact button the player rotates to the side of the cube he is facing to and can move the cube only on the specific axis.

The facing direction is defined by a normal which comes from a forward sphere trace and works pretty well so far. The weird part comes after the move component function: The two branches check the direction of the player and set some variables accordingly, so I can use this information to controle the movement: if he is facing left/right (forward vector Y = 1 or -1) he can only move on the y-axis and vice versa.

So, I don’t know why but sometimes it works well for both axis and sometimes only for the x-axis but not for the y-axis. The bottom branch sometimes doesn’t get to “true” sometimes it does - even if the condition is always met! Sequence doesn’t help. When swapping the nodes (bottom branch is first) then the y-axis works but not the x-axis. Seems like sometimes only the first branch is working.

Am I missing something?

Yes, that was it, the “nearly equal” did the magic! I knew it was something really simple :smiley: Thank you so much!!

I assumed that it was something with the value but the print string always gave me an axis value of 1 or -1 after the break vector. Maybe it was something like 1.0000013… How should I know that it never was or is exactly 1 or -1??

I like your idea of moving the object, I definitely wil play around with this! For now, I use the obejct’s physics, adjusting some settings and see how it works. Still need to adjust the player’s location when in “push position” and figure out a pull system as well… but the basic idea of the movement is done for now I guess :slight_smile:

I’m assuming this is all happening in a grid fashion? In other words, the player can only move items in line with the world XY?

I’m wondering if you’re having a problem because even though the normal from the object is perfect, the normal from the player actor may be off somewhat.

Have you tried using?

329587-screenshot-3.jpg

( or possibly an even bigger error ).

This works for X in one direction. I only have to rougly aligned with the object to move it:

329589-push.gif

Good stuff :slight_smile: