- Home /
i need help with my attack point
right so i am making a melee system but i need to flip the attack point so then when the character is looking left the attack point is also there as right now its looked in one direction. which means i can only actually kill enemies if they are on the right but not if they are on the left
Answer by kassikgaming · May 08, 2021 at 04:24 PM
ok i have figured it out no longer require assistance
ps i done the whole object rotated and a facing right variable and flipped it round like that
Answer by Woxell · May 08, 2021 at 03:21 PM
You can do it like this;
If your character's position.x value equals to 0 and your attack point is 5, difference is 5f;
If your character turns to left new difference should be -5.
You can achieve this by multiplying your attack point's position.x value by -1.
transform.position = new Vector3(transform.position.x * -1, transform.position.y, transform.position.z)
Your answer
Follow this Question
Related Questions
Brawl style melee combat? 0 Answers
Best way to detect sword hit 0 Answers
Melee combat, sphereoverlap not working 1 Answer
Setting Input windows or queuing user input 2 Answers
Melee Combat - Collision Detection 2 Answers