- Home /
The question is answered by xxmariofer, his suggestion of using a LineRenderer helped!
Rhythm Game Long Notes, How to?
So! I'm currently working on making my own rhythm game on Unity, and I got the regular tap notes on lockdown.
I have a chart.txt file which handles the actual charting of the song, i tell it on which beat the note falls, the type of note, which lane and then it's duration if it's long or tap note.
So I was wondering if people could give me a good idea on that? Because I am sure I can translate note duration into seconds, but then the problem I find is how would I translate that into the actual visual length of the note? Would it be wise to simply just scale the note by a factor of the duration? Or is there a different kind of way I can do this, like telling it to spawn a sort of "EndNoteObj" which would connect with the start of the note and draw in a connection between them?
I'd love to hear some suggestions!
If you need any extra info I'd be happy to give it!
i am not sure at all if i understood your question, you want a visual representation of the theme? have you consider using LineRenderer? it is similar to the "draw a connection between 2 objects" you were consdering, linerenderer simplicity makes it really easy to use, if one note begging it is at second 2 and it is 3 seconds long the point 0 would be (0,2) and point 1 (0, 5)
That's actually pretty good! Is there a way to attach a texture to that LineRenderer? I imagine so, cuz if I can that actually makes everything super simple, Imma look into it, thanks!!
You can create a material add a texture to the material and add the material to the línerenderer
Answer by Magso · Jan 20, 2020 at 02:03 PM
Since this is a rhythm game, it would be easier to work with bpm rather than in pure seconds.
Work out the note lengths at 60 bpm so quarter notes are 1 second long, eighths are 0.5 seconds etc these values can be the scale length for each note.
Once this is all charted out you can either speed the whole thing up to the bpm by multiplying the speed by (bpm/60) or keep the same speed but scale everything down so it passes at the bpm rate by multiplying the parent's scale by (60/bpm).
Hmm sorry not exactly the answer I was looking for, see, the way I have it set up is on the TXT chart file, note type 0 is a single tap note, which is just a tap, it has the beat in which it would reach the judgement line, then a lane to know if its on the left or right lane, and then it has a duration which is used when the note type is 1, which is long notes
Long notes would be like...a note that's elongated, sort of like giving it a tail and the duration is also in beats, and would be like saying "make your tail longer by the distance of x number of beats"...
Actually rereading your post, I got an idea of what you mean now, maybe I can try something with that? Have a long note with the length of a quarter note lasting one second (at 60bpm), then simply say in the charter the note duration is 1 for quarter, 0.5 for eighths, 2 for halves , 4 for wholes...and then simply scale it by those numbers, and then I'd have to figure out by how much do i need to move the scaled long note forward (Because unity scales it from the center outwards, to make sure the side that reaches the judgement line in beat, I need to move the note forwards(or backwards))
is that sort of what you had in $$anonymous$$d?
Thanks for the reply!
Follow this Question
Related Questions
Rhythm game long note question 0 Answers
Restricted movement relative to a grid with turns 1 Answer
tags on ContactFilter2D? 0 Answers
Slider for Game-Wide Audio 0 Answers
Virtual Joystick jump in unity2d 0 Answers