Hello everyone! I'm planning to make a new video soon, and I want to know what it should be about. I've made a poll were you can vote on what tutorial you want to see: th-cam.com/users/postUgkxlNK3j28OhTX2d5HF6EQ6W61jAz6YH1vc The more votes, the better!
Great video, you have explained it better than any youtuber there is out there and helped us understand how it works, instead of just telling us to copy paste something. :)
This helped me so much! I was totally stuck at the camera rotation when I was working on my project. Thank you so much! (Stick with it bg music goes brrr)
Wow, I really appreciate your help! Your tutorial was 10 times better than most scratch tutorials with 1 million views. It immensely helped me out with my project!
If you want the camera to move in the direction it's pointing you can change Cam X by the sine of Cam Dir and Cam Y by the cosine of Cam Dir, then multiply both those by a speed. (if that is what you meant) :)
@@SamingoTutorials im having trouble understanding what this means, im trying to put it into the movement formula but instead its just making X not move? could you explain it indepth or send the code in text please 🥺🥺🥺🥺🥺🥺
@the_rat_are_coming I saw this 2 months later and my reply was 6 months ago, so it's hard to remember what I meant, but I think what I meant was this: If you want the camera movement to be relative to the direction of the camera (A.K.A the camera moving normally when rotated), you need to add a counter rotation to the camera's movement. For example, if the camera is rotated 90°, moving the camera up (0° relative to the world), would be moving it to the left (-90° relative to the camera). As I said in the video, when the camera moves, it's like the world moving the opposite. So when the camera is rotated 90°, it's like the world is rotated -90°. If you see the camera movement as a thing in the world, if you want it to be relative to the camera instead, you need to counter it by adding (for example) 90° to the movement's direction. You can do this by either converting the X and Y movement to a direction (using arcsin and arccos), adding the camera rotation, and converting back to X and Y multiplied by the speed. Or by converting the camera direction to X and Y, multiply it by the speed, and adding it to the X and Y movement, this is much easier. It's really complicated to understand, so here is the code that should theoretically work if I have thought about this correctly (I haven't tried it though, it could be wrong): change "Cam X" by ((Right Key - Left Key) + (sin(Cam Dir))) * (10 / Cam Zoom) change "Cam Y" by ((Up Key - Down Key) + (cos(Cam Dir))) * (10 / Cam Zoom) I hope this helps!
The camera controls could be in whatever sprite you want, but the position, rotation and scaling script must be in the sprite you want to work with the camera. That's is the answer if i understood the question right.
Thank you! Don't worry, I'm somehow still gaining subscribers without posting any videos. I still want to make tutorials, but I only want to make useful videos, do you have an idea in mind? (you don't need to answer)
The reason i didn't explain it is because i don't really understand it myself either, but if you just want the math, here it is: x = (((object x - camera x) * camera zoom) * cos(camera direction)) - (((object y - camera y) * camera zoom) * sin(camera direction)) y = (((object y - camera y) * camera zoom) * cos(camera direction)) - (((object x - camera x) * camera zoom) * sin(camera direction)) direction = object direction - camera direction size = object size * camera zoom
To make collisions work with this could be complicated, the best idea i have for the best results is to make a list (or multiple lists) with four hitbox points, then make the other objects move out if they are in one of those boxes, then update those lists every frame. As i said, complicated.
I'm so glad I moved on to unity. Not only do they have all of that built in, they also have a LOT of other functionality. I do not have to endure the purgatory of camera control again 💀💀💀💀
Hello everyone! I'm planning to make a new video soon, and I want to know what it should be about. I've made a poll were you can vote on what tutorial you want to see: th-cam.com/users/postUgkxlNK3j28OhTX2d5HF6EQ6W61jAz6YH1vc
The more votes, the better!
This is such an amazing feature, to the point it is becoming an update for one of my projects eventually.
I know right! I use it i basically all my games!
Great video, you have explained it better than any youtuber there is out there and helped us understand how it works, instead of just telling us to copy paste something. :)
Only video that actually had what i was trying to find on youtube. You're underrated for no reason, thanks man.
Thank you! Glad to help!
This helped me so much! I was totally stuck at the camera rotation when I was working on my project. Thank you so much! (Stick with it bg music goes brrr)
this is actually such a helpful video
You are amazing keep it up
Wow, I really appreciate your help! Your tutorial was 10 times better than most scratch tutorials with 1 million views. It immensely helped me out with my project!
Your the best bro! But I can't figure out the rotation moving way direction.
If you want the camera to move in the direction it's pointing you can change Cam X by the sine of Cam Dir and Cam Y by the cosine of Cam Dir, then multiply both those by a speed.
(if that is what you meant)
:)
@@SamingoTutorials im having trouble understanding what this means, im trying to put it into the movement formula but instead its just making X not move? could you explain it indepth or send the code in text please 🥺🥺🥺🥺🥺🥺
@the_rat_are_coming I saw this 2 months later and my reply was 6 months ago, so it's hard to remember what I meant, but I think what I meant was this:
If you want the camera movement to be relative to the direction of the camera (A.K.A the camera moving normally when rotated), you need to add a counter rotation to the camera's movement. For example, if the camera is rotated 90°, moving the camera up (0° relative to the world), would be moving it to the left (-90° relative to the camera). As I said in the video, when the camera moves, it's like the world moving the opposite. So when the camera is rotated 90°, it's like the world is rotated -90°. If you see the camera movement as a thing in the world, if you want it to be relative to the camera instead, you need to counter it by adding (for example) 90° to the movement's direction. You can do this by either converting the X and Y movement to a direction (using arcsin and arccos), adding the camera rotation, and converting back to X and Y multiplied by the speed. Or by converting the camera direction to X and Y, multiply it by the speed, and adding it to the X and Y movement, this is much easier.
It's really complicated to understand, so here is the code that should theoretically work if I have thought about this correctly (I haven't tried it though, it could be wrong):
change "Cam X" by ((Right Key - Left Key) + (sin(Cam Dir))) * (10 / Cam Zoom)
change "Cam Y" by ((Up Key - Down Key) + (cos(Cam Dir))) * (10 / Cam Zoom)
I hope this helps!
@@SamingoTutorials woah thanks for caring your late but i didn't expect you replying!
@SamingoTutorialsur code doesn't work
i still havent watched the entire tutorial but this editing is AMAZING
Thank you! I'm trying to find a balance between enjoyment and being able to follow the tutorial.
1 question we do the camera in the "Person/character" or do it in our "Map"
The camera controls could be in whatever sprite you want, but the position, rotation and scaling script must be in the sprite you want to work with the camera. That's is the answer if i understood the question right.
k thanks@@SamingoTutorials
Thanks for the tutorial! It has helped me more than once and it works very well!
You know what this was so us full and fun to watch and I actually learned a few things, EASY SUB AND LIKE
u shoud deserve more view and subs your vids are amazing almost like you are an good underrated griffpatch 2
After 1 year NOBODY has subbed to you from this high quality video? What scum they are but i will sub to you my friend 👍👌
Thank you! Don't worry, I'm somehow still gaining subscribers without posting any videos. I still want to make tutorials, but I only want to make useful videos, do you have an idea in mind? (you don't need to answer)
cool tutorials:D
Is there not a way to get the pen tool to just straight up draw your screen, and then use that as the camera?
It could work, but I don't think it's faster than this. You could try it though!
If I want to use it in my game, what be better to put to credits, your TH-cam or scratch name? (I don’t know your scratch name)
No need to put credit! But if you want to, you can link TH-cam. (P.S. Here's my really old Scratch profile: scratch.mit.edu/users/sammebamme )
what is the solution for the roation
?
The reason i didn't explain it is because i don't really understand it myself either, but if you just want the math, here it is:
x = (((object x - camera x) * camera zoom) * cos(camera direction)) - (((object y - camera y) * camera zoom) * sin(camera direction))
y = (((object y - camera y) * camera zoom) * cos(camera direction)) - (((object x - camera x) * camera zoom) * sin(camera direction))
direction = object direction - camera direction
size = object size * camera zoom
THANK YOU I hope u get happy in life
Wow, thank you! You too!
i have a problem,im not doing the scrolling and when we do the devided by camera zoom thing i dont know what to do
If I can see the code or something I'm sure I can help! Otherwise you can watch that part of the video again if you haven't done that already.
why did you choose blue color for your debugger category
It came like that.
thanks
Question: how did he make his own category?
That's a chrome extension called "Scratch Addons", in it you can add a debugger catagory. :D
Can the entity's be independent?
As long as you have the movement scripts in that sprite, yes. The camera controls needs to only be in one sprite.
first
omg so cool
ye
@@SamingoTV boy
@@dalskidan3627 erm i think you forgot to switch to your alt
Can you share the project on Scratch?
Sure! scratch.mit.edu/projects/822455178/
Do the rotation glitch made the rotation 3d 🤯🤯
Yeah, sine does that.
I quit one of my old platformers becuase of this reason so thanks alot
finally, i sorted out zoom.
But how to make colisions Wit that?
To make collisions work with this could be complicated, the best idea i have for the best results is to make a list (or multiple lists) with four hitbox points, then make the other objects move out if they are in one of those boxes, then update those lists every frame. As i said, complicated.
I'm so glad I moved on to unity. Not only do they have all of that built in, they also have a LOT of other functionality. I do not have to endure the purgatory of camera control again 💀💀💀💀
you the goat for this