Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question can't move spliced sprites?

Discussion in 'Animation' started by blinkoutatime, Aug 19, 2023.

  1. blinkoutatime

    blinkoutatime

    Joined:
    Nov 25, 2020
    Posts:
    10
    Hi all, im new here and been working on my game for the past month or so. It's a space shooter with asteroids. It looks like you can't just simply use a 3d model in a 2d space for obvious reasons. So that leaves me to "emulate" the 3d look using sprites. I have an asteroid sprite sheet and when I use sprite editor to splice it, I click apply, I see the grid, and I don't know what to do after that. I do have the sprite set to multiple in inspector btw. I have an astroid prefab with rotation and move scripts so they randomly "float" into game scene from edges, How do I use my sprites to create this animation because you cannot drag the spliced sprites from the sprite editor. I dragged the sprite Sheet into the the game scene and nothing happens. I drag it to the prefab and nothing happens, the animator component does not have anywhere to drag sprites to. This is extremely confusing for me. Could anyone help me setup an asteroid prefab with animation? I feel like I'm doing something wrong. Thanks in advance :)
     
    Last edited: Aug 19, 2023
  2. Cornysam

    Cornysam

    Joined:
    Feb 8, 2018
    Posts:
    1,439
    Before we go down this path of 2D sprites and animation, i will say its 100% possible to put a 3D model on top of a 2D space. I'm happy to help.

    For a basic example, put a sprite as the background (like on a UI canvas, just for testing) and reset it's transform to 0,0,0. Then, pull in your asteroid prefab and also reset its transform. Adjust your camera to show these objects in the game view. Then add your movement and rotation code and as long as the 3D asteroid doesn't "go behind" or "cross" the sprite background or outside of the camera's viewpoint, you should see it.

    Let me know if you have any questions or have errors (screenshots works great)

    Hope that works!