Timetrial Ghosts in Unity
Record your characters movement and play it back for time trial races and other cool effects. Adding ghosts to your game provides friendly competition between friends and lets players observe how the worlds best went about handling a level.
Source: github.com/Matthew-J-Spencer/...
Time-trial: tarodev.itch.io/extended-ulti...
❤️ Become a Tarobro on Patreon: / tarodev
=========
🔔 SUBSCRIBE: bit.ly/3eqG1Z6
🗨️ DISCORD: / discord
✅ MORE TUTORIALS: / tarodev
Пікірлер: 73
I ve come to a point where i confidently understand Unitys basics, and your channel is exactly what i ve been looking for in my current state of skills. Thank you for helping us to transcend from knowing the basics
Must say, that is some INCREDIBLY smooth squash and stretch. And the ghost system is going to save me multiple hours of banging my head on the keyboard :3
Man, you're hitting it out of the park with these highquality videos :D
@Tarodev
2 жыл бұрын
Thanks Rob :) Wasn't really too sure about this video, but hopefully the script can help some people!
Thank you so much for these amazing videos. You've hit the nail on some of the aspects I've been struggling transitioning from mobile to game development. Such as architecture, best practices and workflow.
@Tarodev
2 жыл бұрын
Thanks buddy 😊
Very cool tutorial and insight, thanks man!
Great video and great script :) Thank you for the time and effort spent on this kind of scripts :) Once again you did an awesome job
Another amazing video Mr Taro. Loved plying this game, keep up the amazing work! ☺
@Tarodev
2 жыл бұрын
Thank you mandy
That was very concise coverage. When I first made something like this, I used linear interpolation between frames. Many months later I saw some code that utilzed animation curves for this to have much smoother movement. I was like "why didn''t I think of this myself". Pretty powerful. That speed trial game looks fun too, will give it a try later!
@ryuuguu01
Жыл бұрын
Mirror has good interpolation code that is open source. it is even a separate class and generalized so it is easy to use with outside of Mirror.
Cool . Very excited to know this kind of features in Unity.
Thanks for this. Really cool and helpful!
Great Video. Thanks for giving a new div like me a chance to learn how to code.
This channel is a goldmine
Awesome video 👍
Really helpful video!
So generous. Great content 👌
Thank you for your help 🖤
This channel is perfect!
More excellence! Thank you.
there's a good free rewind asset on the asset store "ReTime" which you can use to save time expanding your asset.
@Tarodev
2 жыл бұрын
Oh cool, I'll checkout how he accomplished it, thanks!
Awesome tutorial! Chuckled a bit at nickname 0:13
It's like and Ori and the will of the wisps, Cool video
Very interesting!
I think you could do something like: 1. record position and rotation of player every X ms (say every 200ms). 2. on playback, do position and rotation interpolation per each coordinate recorded. Basically an approach similar to how server-client relationship works...
Cool stuff! One optimization could be to, rather than just recording position/rotation every X frames, record the input and time of input. This way you can greatly reduce the amount of data needed, while keeping the gameplay precise, as it'll essentially just handle all the physics itself exactly as the prefab would normally. You'd just need to create a variant of the original that doesn't take input.
@MasterDisaster64
2 жыл бұрын
But that would cause it to desync if the player can change the environment in any way (as they can in most games).
@gammafoxtbg
2 жыл бұрын
@@MasterDisaster64 Yes, but that depends on the context. In that case, you might want to also make sure you're not recording certain actions that could cause those environmental changes, but still record movement inputs. Or, if for example you have things like boxes you can push around, you could create ghosts of those as well, create ghost layers for boxes and players, and change your physics settings to only allow interactions between the relevant layers.
@Tarodev
2 жыл бұрын
I initially tried using input, but as the physics engine is not deterministic it yields unreliable results. That's also with a clean playing field, imagine now we add push able objects which cause drag on the player... This would unsync the ghost. I know track mania uses input based recording, but they've done some funky stuff with their engine to handle it. Not sure how possible it is in Unity + physics controllers.
@Mr_Yeah
2 жыл бұрын
@@Tarodev Trackmania has it all: It has a fully deterministic physics engine. Although the results can change with a big update that, e.g., adds new track parts. And thus, it saves both the player's position and input in the replays. When replaying, it uses the positions because that's independent of versions. But if you also have a compatible version, you can let it check the replay for tampering. It does that by simulating the run with the inputs off-screen and comparing the calculated positions with the recorded ones.
@Tarodev
2 жыл бұрын
@@Mr_Yeah very interesting. It's a pretty fun topic I must say. I'm going to play around the interpolation between key frames and see how smooth I can make low frame rate recordings. Input recordings have a huge advantage in that they don't even need to interpolate. Certainly the go-to for anything none physics based in Unity
Amazing video. Looking forward to checking it out. Is it possible that you make a video on how to do online Leaderboards?
@Tarodev
2 жыл бұрын
Hey Seb, my (most probably) next video is about game authentication and most probably a leaderboard :)
@UitzUitz
2 жыл бұрын
@@Tarodev Amazing. I'm so glad that I found your KZread channel last year. All your videos are just amazing. Love how you don't waste any of my time and get directly to the point every time with the best explanations. Keep up the great work.
nice video
Smooth and fun .. nice video. Ps: can you share the link of the mini game you show.
Greattt
Really insane!! 2:34 though.😂😂😂
@Tarodev
2 жыл бұрын
I was no match for Nick
Fuck, you keep making cool stuff.
@Tarodev
2 жыл бұрын
:D Making cool stuff is fun
You're like the Default Cube Blender guy but for Unity. :)
@Tarodev
2 жыл бұрын
Ahh, thanks buddy
Tarobro! nice, is this already available?
Noice
Im a fan. Love you bro. No Homo 😆
Thanks for your videos. They are very reassuring when there is a war outside the window. Kyiv, Ukraine
@Tarodev
2 жыл бұрын
Keep safe brother 🙏
why are u so smart
hlo bro can u teach us about unity finite state machines plz
Best time I got was a 13:960. Could go faster but I'm happy with that time.
@Tarodev
2 жыл бұрын
That's insane. You must be a dash master
@neropatti
2 жыл бұрын
@@Tarodev Ended up grinding some more. Stole the #1 position on the leaderboard, for now :)
I'm really struggling to achieve the upload 'somewhere' the ghost and then download from the leaderboard, I' ve a nice and functional ghost system but it works only local, I've tried to save ghosts (wich are json files) to unity cloud save, but It'seems to me that nobody can acces them , other than the player who made it.....Maybe a little hand from someone will help me!
is it possible to make this happen in real time?
early gang
Turning it for MOBILE DEVICES would be really helpful...
@Tarodev
2 жыл бұрын
Mobile will work perfectly fine :)
@anantgamedev
2 жыл бұрын
@@Tarodev ohk!
@13cbt13
2 жыл бұрын
Why are you yelling?!?!?
@anantgamedev
2 жыл бұрын
@@13cbt13 im not
Early
Recording the position rather than recording the inputs?
@Tarodev
2 жыл бұрын
Unfortunately unless the physics engine is deterministic, recording input isn't really an option.
@tudorelRo
2 жыл бұрын
@@Tarodev That is a good point, but isn't your character controller not using physics (because I remember this => kzread.info/dash/bejne/ZaeLttyGo9DKqJs.html min 0:27)? And if so wouldn't it be possible to record the inputs rather then positions? Also I have another question: why use coroutines instead of async/await ? Thanks for the video as allwais it was nice.
@IgnacioStegmayer
2 жыл бұрын
@@tudorelRo nevermind me, just warding your two great questions in case taro replies to them
@Tarodev
2 жыл бұрын
@@tudorelRo good question. It's because async await does not have a frame-dependant wait, like coroutines do.
Pᵣₒmₒˢᵐ