Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

GUN AIMING BECAME WEIRD WHEN FLIPPED PLAYER

Discussion in '2D' started by harithaiman555, Nov 8, 2019.

  1. harithaiman555

    harithaiman555

    Joined:
    Jun 15, 2019
    Posts:
    3
    Everything was fine when my player doesnt flip. But when flipped my gun's butt are aiming. Like before, the muzzle is following my mouse but when i flip the butt follow my mouse. The gun is the child of the player.. how do i fix thiss
     
  2. eses

    eses

    Joined:
    Feb 26, 2013
    Posts:
    1,370
    @harithaiman555

    I just wonder how you expect to get help:

    - You don't show your code
    - You don't show your object hierarchy image
    - You don't show an image of your character in scene

    Maybe someone will recognize the exact case, but if you don't put much effort in your question, don't expect much help either...

    And it doesn't help to "shout" i.e. use uppercase in your question heading.
     
  3. MisterSkitz

    MisterSkitz

    Joined:
    Sep 2, 2015
    Posts:
    638
    You most likely are rotating the Parent object when "flipping" and consequently your child objects are also rotating. An easy fix for this would be to create an empty object. Name it PlayerHolder (Or whatever you want). Drag your player into the PlayerHolder. Drag all of the child objects out of your player and into the PlayerHolder. Now you should be able to flip without altering your weapons rotation because it is no longer a child of the player but of the PlayerHolder.