Forum begins after the advertisement:
-
::I used the sprite given in the link in the description to see if the basic mechanics work. now i made a new sprite combining body parts and animating them. I gave it the player controller script and gave the same attributes to it and animated it. But when i insert it to the scene it appears behind everything and is unresponsive. (There are no error messages).
View post on imgur.com
::Update: it is responsive but it still appears invisible(its sorting layer is the same as the players). And its pivot point is misplaced as seen in the video below.
::
Why are my video clips invisible?
::Update 2: the body parts were on the default layer even though the parent object was in midground, that’s why it appeared invisible. And I cant move my characters pivot point because it doesn’t have an avatar for the sprite renderer as it is not a single sprite. What can i do to fix this
::Anuk, your clips are invisible because you just need to paste the Imgur URL like so:
https://imgur.com/a/H2YBe8G
But you put them in IMG tags, which doesn’t work:
<img src="https://imgur.com/a/H2YBe8G"/>
As for the Sprite Sheet pivot points, you should be able to change the pivot point for each sprite in the Sprite Editor: https://discussions.unity.com/t/how-do-i-change-multiple-pivot-points-in-the-sprite-editor/119405
::To add on, I think an easier solution to change all the pivot point of your character to the center is to:
- Select all your character’s body parts.
- Right-click and “Create Empty Parent”. This parent should have naturally been created in the center point of your selected body parts.
- If your empty parent is under another parent object, set it’s Transform Position values to (0, 0, 0).
::Thanks alot. worked out first try
::View post on imgur.com
this is a minor problem but i want to make my character a bit bigger but after i resize the body parts and move after i run the game, the sprite gets squished sideways
::The reason for the squish is due to the movement code for the Player. We set the X Scale to [1] and [-1] to flip the player every time they change directions.
But this should be no issue if you did this:
- Make sure that the assigned Player (Your PlayerController.cs) is an Empty Parent [Parent 1].
- Place your Character’s sprite under a separate Parent [Parent 2], which is under Parent 1.
- Change the Scale of Parent 2 to the size that you wish.
The order should be
[Parent 1] > [Parent 2] > [Character sprites]
Where Parent 1 is your Script and assigned Player & Parent 2 is the center pivot for your Player.
Do tell me if this works, since I have not tested this method, purely theory.
Advertisement below: