Inverting Numeric Values

SO back again with my small brain which needs help from the bigger brained humans. Im here to ask for help to invert numbers, because i wanna make a facing at block but it faces the opposite way.

1 Like

A*-1 will swap it, unless you want something else, if you want flipped angles add 180 in an expression.

4 Likes

Is it facing an object through rotation? Or just a platform facing?
Like what Galactian said, I would just multiply the output by -1 to invert the number since you may have gotten your negative mixed up with direction.

2 Likes

its a topdown sooooo there isnt really a direction

1 Like

I can’t help you if I have no idea what help you are asking for.

2 Likes

What I meant by direction, was the facing value. Cause you are obviously facing in a direction, whether it be on a platformer on the X axis, or a top down game being on the X and Y axis.

Although a top down is more complex cause it really depends on the game you have. Are you a character that can only face in four different directions, Up, Down, Left, and Right? Or are you a character that can rotate around in the environment to face something?

1 Like

I think i’ve figured out what you want, you want an up top player to look away from an object. You can do this by extracting that object’s position, putting it into an angle to bundle, and adding 180 to the angle.

1 Like

You could change the objects facing directions, such as changing it to Up or Left since the default is right. Which would help if you make a sprite in the wrong direction, you could change the facing value.

Then again I’m not entirely sure since I don’t know what type of game @Lordkhalton has in mind.

Ok heres my exact concept, an ai the flees when it detects a zombie in its proxy, so i need to invert the proxy detection to run away from it

I did this exact thing, but I had when the player (who is a monster) comes in contact with an NPC they start to run away in the direction you approached them from. But since I had strict hallways I only had four directions such as Up, Down, Left, and Right.

I would say you could use the same concept, but mine only works if there is just one entity. Since you have zombies there are more than one so extractors won’t work properly.
So I’m not entirely sure how that would work.

1 Like

You can probably get its X and Y velocity and just put that into your AI so it moves in the same direction as the zombie, which is away from it. If this doesn’t work I’ll send you a more in-depth description and a screenshot of something else you can do.

I would use Proximity → AngleTo → +180 → Rotate → Move Forward

1 Like

Exactly. That’s what I said, I have absolutely 100% no idea why he ignored it

1 Like

Well you see Mr. Galactian, JR01 explained it just a little better with a little arrow example, You explained it very confusingly.

But besides that Ive made a working Infection System