Search Unity

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

Question I have a problem with the development of a minigame

Discussion in 'Scripting' started by GameDev_A, Nov 28, 2023.

  1. GameDev_A

    GameDev_A

    Joined:
    Sep 5, 2022
    Posts:
    43
    Hi everyone,
    I'm a beginner developer in Unity and I'm trying to create a 2d minigame.
    The idea is that the player character moves alone to a specific point, watches a video, answers a quiz and, if passed, moves, always automatically, to another point.
    Currently, I have managed to implement the mechanics of the video and almost completely that of the quiz, but my biggest problem is the automatic movement.
    If any of you have experience in these areas or know of tutorials, I would be extremely grateful if you could share your knowledge or provide me with links to relevant resources.

    Thank you so much!
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,321
    Easiest: Make an animation.

    Second-easiest: write some code to use a tweener (DOTWeen, LeanTween)

    Hardest: write your own code to do the movement.

    If you want the third option, perhaps use the Navigation system (UnityEngine.AI) or else just make a waypointing system and have your agent follow the waypoints.
     
  3. GameDev_A

    GameDev_A

    Joined:
    Sep 5, 2022
    Posts:
    43
    Ok thanks, but, in 2D, can you have a non-linear movement with DOTWeen/LeanTween? so the character perhaps goes obliquely then goes up, down, etc
     
    Last edited: Nov 29, 2023
  4. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,587
    If you want movement in a curve, then a tweening library that supports splines would work. I don't know about DoTween/LeanTween, but there's another free library called SURGE that does that. I've used the spline solver before and it's pretty fast. I had 200 of them running at the same time and maintained 60fps.

    https://assetstore.unity.com/packages/tools/utilities/surge-107312
     
    Kurt-Dekker likes this.
  5. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,321
    Why don't you go find out?

    Hint: the answer is YES. The answer is always YES. It's up to YOU to make it happen. This is a self-service enterprise.


    The purpose of this forum is to assist people who are ready to learn by doing, and who are unafraid to get their hands dirty learning how to code, particularly in the context of Unity3D.

    This assumes you have at least written and studied some code and have run into some kind of issue.

    If you haven't even started yet, go check out some Youtube videos for whatever game design you have in mind. There are already many examples of the individual parts and concepts involved, as there is nothing truly new under the sun.

    If you just want someone to do it for you, you need go to one of these places:

    https://forum.unity.com/forums/commercial-job-offering.49/

    https://forum.unity.com/forums/non-commercial-collaboration.17/

    https://livehelp.unity.com/?keywords=&page=1&searchTypes=lessons

    Remember this is YOUR game, not ours. We have our own games we're working on.


     
  6. GameDev_A

    GameDev_A

    Joined:
    Sep 5, 2022
    Posts:
    43
    Ok thanks, I'll try that
     
  7. GameDev_A

    GameDev_A

    Joined:
    Sep 5, 2022
    Posts:
    43
    ok, sorry