How To Make A SCROLLING, ZOOMING AND ROTATING CAMERA IN SCRATCH

แชร์
ฝัง
  • เผยแพร่เมื่อ 30 ม.ค. 2025

ความคิดเห็น • 66

  • @SamingoTutorials
    @SamingoTutorials  หลายเดือนก่อน +1

    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!

  • @McSpeedster2000
    @McSpeedster2000 ปีที่แล้ว +8

    This is such an amazing feature, to the point it is becoming an update for one of my projects eventually.

    • @SamingoTutorials
      @SamingoTutorials  10 หลายเดือนก่อน +2

      I know right! I use it i basically all my games!

  • @sacred-blade
    @sacred-blade 10 หลายเดือนก่อน +3

    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. :)

  • @Flipsideprod
    @Flipsideprod ปีที่แล้ว +6

    Only video that actually had what i was trying to find on youtube. You're underrated for no reason, thanks man.

  • @Alex-is-Procrastinating
    @Alex-is-Procrastinating ปีที่แล้ว +4

    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)

  • @silvermedal
    @silvermedal วันที่ผ่านมา

    this is actually such a helpful video

  • @tmansdigistudios1675
    @tmansdigistudios1675 ปีที่แล้ว +5

    You are amazing keep it up

  • @GoofyGoober-mn5qs
    @GoofyGoober-mn5qs 5 หลายเดือนก่อน +1

    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!

  • @PlatformerGamesYesDEV
    @PlatformerGamesYesDEV 9 หลายเดือนก่อน +3

    Your the best bro! But I can't figure out the rotation moving way direction.

    • @SamingoTutorials
      @SamingoTutorials  9 หลายเดือนก่อน +5

      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)
      :)

    • @the_rats_are_coming
      @the_rats_are_coming 4 หลายเดือนก่อน +1

      @@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 🥺🥺🥺🥺🥺🥺

    • @SamingoTutorials
      @SamingoTutorials  2 หลายเดือนก่อน +2

      @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!

    • @PlatformerGamesYesDEV
      @PlatformerGamesYesDEV 2 หลายเดือนก่อน +1

      @@SamingoTutorials woah thanks for caring your late but i didn't expect you replying!

    • @bgtweesher
      @bgtweesher 19 วันที่ผ่านมา

      ​@SamingoTutorialsur code doesn't work

  • @realafarzan
    @realafarzan ปีที่แล้ว +1

    i still havent watched the entire tutorial but this editing is AMAZING

    • @SamingoTutorials
      @SamingoTutorials  10 หลายเดือนก่อน +1

      Thank you! I'm trying to find a balance between enjoyment and being able to follow the tutorial.

  • @extracontext-x2z
    @extracontext-x2z 11 หลายเดือนก่อน +2

    1 question we do the camera in the "Person/character" or do it in our "Map"

    • @SamingoTutorials
      @SamingoTutorials  10 หลายเดือนก่อน +2

      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.

    • @extracontext-x2z
      @extracontext-x2z 10 หลายเดือนก่อน +1

      k thanks@@SamingoTutorials

  • @theddawwroni
    @theddawwroni 5 หลายเดือนก่อน +2

    Thanks for the tutorial! It has helped me more than once and it works very well!

  • @LandenS-l3i
    @LandenS-l3i 4 หลายเดือนก่อน +1

    You know what this was so us full and fun to watch and I actually learned a few things, EASY SUB AND LIKE

  • @n1Ce911
    @n1Ce911 6 หลายเดือนก่อน +1

    u shoud deserve more view and subs your vids are amazing almost like you are an good underrated griffpatch 2

  • @Jasher144
    @Jasher144 3 หลายเดือนก่อน +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 👍👌

    • @SamingoTutorials
      @SamingoTutorials  2 หลายเดือนก่อน +1

      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)

  • @VuNguyenMinhKhang
    @VuNguyenMinhKhang 5 หลายเดือนก่อน +1

    cool tutorials:D

  • @ada_funni
    @ada_funni 3 หลายเดือนก่อน +1

    Is there not a way to get the pen tool to just straight up draw your screen, and then use that as the camera?

    • @SamingoTutorials
      @SamingoTutorials  3 หลายเดือนก่อน +1

      It could work, but I don't think it's faster than this. You could try it though!

  • @ertconsole
    @ertconsole หลายเดือนก่อน +1

    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)

    • @SamingoTutorials
      @SamingoTutorials  หลายเดือนก่อน +1

      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 )

  • @Theflit
    @Theflit ปีที่แล้ว +2

    what is the solution for the roation
    ?

    • @SamingoTutorials
      @SamingoTutorials  10 หลายเดือนก่อน +4

      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

  • @pixelpeaa
    @pixelpeaa 2 หลายเดือนก่อน +1

    THANK YOU I hope u get happy in life

  • @ElizabethAftonwow
    @ElizabethAftonwow 6 หลายเดือนก่อน +1

    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

    • @SamingoTutorials
      @SamingoTutorials  4 หลายเดือนก่อน +1

      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.

  • @96isthebestnumber
    @96isthebestnumber 3 หลายเดือนก่อน +1

    why did you choose blue color for your debugger category

  • @TheScratchMaster213
    @TheScratchMaster213 2 หลายเดือนก่อน +1

    thanks

  • @BikeLifeVQ
    @BikeLifeVQ 10 หลายเดือนก่อน +1

    Question: how did he make his own category?

    • @SamingoTutorials
      @SamingoTutorials  10 หลายเดือนก่อน +2

      That's a chrome extension called "Scratch Addons", in it you can add a debugger catagory. :D

  • @Nokoribi876
    @Nokoribi876 8 หลายเดือนก่อน +1

    Can the entity's be independent?

    • @SamingoTutorials
      @SamingoTutorials  8 หลายเดือนก่อน +2

      As long as you have the movement scripts in that sprite, yes. The camera controls needs to only be in one sprite.

  • @dalskidan3627
    @dalskidan3627 ปีที่แล้ว +4

    first

    • @dalskidan3627
      @dalskidan3627 ปีที่แล้ว +1

      omg so cool

    • @SamingoTV
      @SamingoTV ปีที่แล้ว +1

      ye

    • @dalskidan3627
      @dalskidan3627 ปีที่แล้ว +1

      @@SamingoTV boy

    • @koala9729
      @koala9729 4 หลายเดือนก่อน +1

      @@dalskidan3627 erm i think you forgot to switch to your alt

  • @kadirdemirbilek8207
    @kadirdemirbilek8207 5 หลายเดือนก่อน +1

    Can you share the project on Scratch?

    • @SamingoTutorials
      @SamingoTutorials  4 หลายเดือนก่อน +1

      Sure! scratch.mit.edu/projects/822455178/

  • @NoTopicError
    @NoTopicError 4 หลายเดือนก่อน +1

    Do the rotation glitch made the rotation 3d 🤯🤯

  • @shawnlau.
    @shawnlau. 5 หลายเดือนก่อน +1

    I quit one of my old platformers becuase of this reason so thanks alot

  • @grzyb11
    @grzyb11 ปีที่แล้ว +1

    finally, i sorted out zoom.

  • @goofyahanimejszyn-fe7kp
    @goofyahanimejszyn-fe7kp 11 หลายเดือนก่อน +1

    But how to make colisions Wit that?

    • @SamingoTutorials
      @SamingoTutorials  10 หลายเดือนก่อน +1

      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.

  • @Someone_43
    @Someone_43 4 หลายเดือนก่อน +2

    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 💀💀💀💀

  • @cakesan69
    @cakesan69 4 หลายเดือนก่อน +1

    you the goat for this