Forum begins after the advertisement:


[Part 3] Ginormous slash size

Home Forums Video Game Tutorial Series Creating a Metroidvania in Unity [Part 3] Ginormous slash size

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #19034
    Spider Beast
    Level 1
    Participant
    Helpful?
    Up
    0
    ::

    So I’m following the tutorial and I have used the same slash animation pack but for some reason my slash is ginormous. I’ve tried increasing the pixels per unit but that squishes the animation a lot and makes the up and down slashes pretty small. If anyone has a solution, please let me know

    #19035
    Ser Apustaja
    Level 6
    AI Assistant
    (BETA)
    Helpful?
    Up
    0
    ::

    Hey Spider Beast! 🕷️

    It sounds like you’re dealing with a scaling issue in your animation. Here are a few things you can try to fix the size of your slash animation without squishing it:

    1. Adjust the Animation Scale: Instead of changing the pixels per unit, try adjusting the scale of the GameObject that the animation is attached to. You can do this in the Transform component by modifying the Scale values (X, Y, Z). This way, you can keep the original animation size intact while making it fit your needs.

    2. Animation Import Settings: Check the import settings of your animation. Sometimes, the scale factor can be set in the import settings of the sprite or animation file. Make sure the “Pixels Per Unit” setting is appropriate for your project.

    3. Animation Frame Size: If the animation frames themselves are too large, consider editing the sprite sheet or individual frames in an image editing tool to reduce their size while maintaining the aspect ratio.

    4. Parent Object Scaling: If your slash animation is a child of another GameObject, make sure that the parent object’s scale is set to (1, 1, 1). Scaling the parent can affect the size of the child objects.

    5. Check for Additional Scripts: If you have any scripts that manipulate the scale or size of the slash animation, make sure they are not inadvertently causing the issue.

    Try these suggestions and see if they help! If you’re still having trouble, feel free to share more details about your setup, and I’ll do my best to assist you further! Happy coding! 🖥️✨

    #19036
    Spider Beast
    Level 1
    Participant
    Helpful?
    Up
    0
    ::

    Thanks, the sideways slash is now fine but the up and down slashes are really tiny, do you know how to fix it? I tweaked the scale and pixels per unit to fix the sideways slash btw.

    #19037
    Ser Apustaja
    Level 6
    AI Assistant
    (BETA)
    Helpful?
    Up
    0
    ::

    To fix the issue with the tiny up and down slashes, you can try the following:

    1. Adjust Scale: Just like you did with the sideways slashes, you can increase the scale for the up and down slashes. Look for the scale settings in your rendering tool or game engine and adjust them accordingly.

    2. Check Pixels Per Unit: Ensure that the pixels per unit setting for the up and down slashes is set appropriately. Sometimes, if this value is too high, it can make objects appear smaller than intended.

    3. Modify the Sprite Size: If you’re using sprites, you can directly modify the sprite size or the texture size in your graphics software before importing it into your project.

    4. Use a Different Font or Texture: If you’re using a font or texture that doesn’t have adequate resolution for the up and down slashes, consider using a higher resolution texture or a different font that scales better.

    5. Inspect Transform Settings: Make sure the transform settings (like position, rotation, and scale) of the up and down slashes are correct. Sometimes, unintended scale changes can make objects appear smaller.

    6. Review Aspect Ratio: If your project has settings for aspect ratio or resolution, ensure they are set correctly, as this can affect how objects are rendered.

    Adjust these settings and see if the up and down slashes appear larger. Let me know if you need more specific guidance based on the software or engine you’re using!

    #19038
    Spider Beast
    Level 1
    Participant
    Helpful?
    Up
    0
    ::

    It’s in unity, from what I understand the up and down slashes are the sideways slash but rotated, so these solutions will unfortunately not work.

    #19039
    Ser Apustaja
    Level 6
    AI Assistant
    (BETA)
    Helpful?
    Up
    0
    ::

    If the up and down slashes are just the sideways slash rotated and they appear tiny, it sounds like there might be a few factors at play in Unity. Here are some suggestions to address the issue:

    1. Check the Original Sprite Size: Ensure that the original texture or sprite for the sideways slash is large enough. If the original sprite is small, rotating it won’t make it appear larger.

    2. Modify the Scale After Rotation: When you rotate the sprite, you can also increase its scale in the Transform component. Make sure to adjust the scale uniformly or according to how you want the sprite to appear.

    3. Use a RectTransform: If you’re using UI elements, ensure that you’re working with a RectTransform. You can adjust the width and height of the RectTransform to ensure that the rotated slashes appear at the desired size.

    4. Adjust Pixels Per Unit: Revisit the Pixels Per Unit setting in the import settings for the sprite. Even if the sideways slash was fixed, you might need to adjust this setting for the up and down slashes if they are derived from the same texture.

    5. GameObject Hierarchy: If the slashes are part of a hierarchy, check if there are any parent objects that have scale modifications which could be affecting the size of the rotated slashes.

    6. Check for Anti-Aliasing or Filtering: Sometimes, the way textures are filtered (like point vs. bilinear) can make them appear smaller or more blurred. You can try adjusting these settings in the texture import settings.

    7. Use a Shader: If you are comfortable with shaders, you could also create a custom shader that adjusts the visual representation of the slashes based on their rotation.

    Try these approaches, and see if they help in making the up and down slashes appear larger. Let me know if you need further assistance!

    #19042
    Terence
    Level 31
    Keymaster
    Helpful?
    Up
    0
    ::

    Hi @spiderbeast, do you have a screenshot of the slash and a screenshot of its attributes in the Inspector? That will help me pinpoint what might be configured wrong in yoru slash.

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.

Go to Login Page →


Advertisement below: