Search Unity

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

Question How to do Stroke Orders for Hiragana character

Discussion in 'Animation' started by Lowzh, Dec 6, 2023.

  1. Lowzh

    Lowzh

    Joined:
    Mar 14, 2023
    Posts:
    2
    I am doing a Hiragana learning game in unity. However, I am wondering how to do the stroke orders just like https://mochidemy.com/kana/lesson/hiragana
    It can be exactly the same as the idea of the website above just playing the stroke orders animation or requiring user input to draw the stroke following fixed path. Anyone can give me the idea as I am new to unity.
     
  2. halley

    halley

    Joined:
    Aug 26, 2013
    Posts:
    2,281


    Step one: find or author a stroke-order SVG or similar format. Review it for accuracy, as I have seen some that claim the correct stroke order but are not correct.

    Step two: parse that data into something you can use more directly, like a series of bezier curve segments, ideally with a stroke width at each node along the curve.

    If you're going to require the user input to draw a stroke, and then detect if it resembles the currently expected stroke, then you will need to know quite a bit of curve mathematics to correlate two strokes to see how different they are, on the criteria you choose-- starting position, direction, curvature, midpoint position(s), ending position.

    Just a warning, this is not a "new to Unity" kind of project, by the way. It's going to take a while to learn your way around, and you should probably do some Unity Learn project(s) to get comfortable with the way things get put together. If you're not already a C# coder, that's another skill you should try to build before tackling this.
     
  3. Lowzh

    Lowzh

    Joined:
    Mar 14, 2023
    Posts:
    2
    Thank you so much for your advice. It is helpful for me.