Create an AR Game with RealityKit - Swift Tutorial

Поделиться
HTML-код
  • Опубликовано: 27 мар 2020
  • Learn how to use RealityKit to create a simple and fun augmented reality pairs game.
    🎯 SWIFT UI COURSE - JUST $12.99 (valid until May 4th 2020) 🎯
    www.udemy.com/course/build-ap...
    ➡️ Tutorial Files: / 35356572
    👏 Support me on Patreon: / brianadvent
    ➡️ Web: www.brianadvent.com
    ✉️ COMMENTS ✉️
    If you have questions about the video or Cocoa programming, please comment below.
  • ХоббиХобби

Комментарии • 41

  • @rgenericson5361
    @rgenericson5361 4 года назад +3

    Brian was the very first iOS instructor I found and followed on RUclips over 3.5 years ago. We built a login screen after creating the graphics in Sketch. That feeling I got the first time I saw it run on my iPhone was priceless! Just purchased the Udemy course, looks great!

  • @viktorosadsky5582
    @viktorosadsky5582 4 года назад +1

    Beautiful video Brian, keep up the great work!

  • @zainraz4
    @zainraz4 4 года назад +1

    Keep up the great videos! :D I’ll definitely have a go at making this app!

  • @linoycelolichin5422
    @linoycelolichin5422 4 года назад +2

    Would love an updated video where the cards flip back if they aren't the same until the player wins! Love the videos!!

  • @Mike-vj8do
    @Mike-vj8do 3 года назад

    Great video! I showed this video in class and it helped us so much, so thanks! Lots of support from Germany.
    We have a question if you don't mind, do you know how we could use ar to automatically measure somebody's height? We would want to point the camera at a person and it to measure their height automatically, do you know how to do that by any chance?
    Don't worry if you don't get around to answering this, you are probably very busy. Thank you very much anyway and continue with the great content!
    And happy new year to you!

  • @ilyamazhuhin1021
    @ilyamazhuhin1021 4 года назад

    man....U r the best!
    Thank u so much

  • @PainlessProgramming
    @PainlessProgramming 4 года назад

    Very cool. Thanks you!

  • @guruitcompany
    @guruitcompany 4 года назад +1

    Great thank you very much

  • @theprofessors6113
    @theprofessors6113 4 года назад

    Great video! Love the idea! One question as I am trying to tweak your code a little: If I want to resize the models one by one instead of all having the same scaling transform, how do I refer to each of them? I tried to use entity.name == "01" in your for loop that does the resizing but that does not work...

  • @WeDeyCode
    @WeDeyCode 3 года назад +1

    If it takes a while to load, know that it's because rendering images `loadAsync` for all 8 images on 16 tiles will be a large computation.

  • @norahamad_eng
    @norahamad_eng 3 года назад

    Hello Mr. Brain, thank you for this great tutorial, I have some question when I create more than one realty composer file in the same Xcode project. Xcode only saw one realty composer file, another one will be invisible by Xcode. so pls is there anyone could help

  • @iMoabPlayer
    @iMoabPlayer 4 года назад +1

    Hi Brian, how to I check if one card content is equal to another? (in order to add some rules and let my kids play!)

  • @webprogi46
    @webprogi46 3 года назад

    So this is a tutorial from Apple's WWDC 2019 Building Apps with RealityKit session. When you go further they recommend to store some custom properties and functions in to an own entity. So far so good but I am not able to cast the entity to my CustomEntity inside the onTap function. Can somebody help?

  • @hellocony3727
    @hellocony3727 4 года назад

    Hi,
    does anyone know how to play the built-in animation which comes with the model?
    Thanks in advance.

  • @aneshc3
    @aneshc3 3 года назад

    Great Video, everything was clear. Smale feedback, sometimes you're a bit to fast, so it's not always easy to watch along.

  • @user-yd9xy3rb4x
    @user-yd9xy3rb4x 2 года назад

    Damn it’s sooooo easy.

  • @randlyce
    @randlyce 3 года назад

    .sink(receiveCompletion: {error in print ("Error = \(error)") cancellable?.cancel() i got an error saying: Insert ';'

  • @amargupta1081
    @amargupta1081 4 года назад +4

    Im getting an error when i type "plane" ect at 4:08

    • @lowchenyi
      @lowchenyi 4 года назад +1

      Make sure your device is for 'Generic IOS Device'. I think that will solve the issue

  • @bobbu7229
    @bobbu7229 4 года назад

    totally new about this. i use windows and android. can it be done using those two

  • @stapa1945
    @stapa1945 2 года назад

    how to scale objects ??

  • @muhammeduwaisebrahim9348
    @muhammeduwaisebrahim9348 4 года назад

    Hi. I’m getting an error at 28:00 code: objects.append(entity.clone(recursive: true)). Actually two errors one saying must change to ModelEnitity and the second is something about the clone. Can anyone pls help.

    • @ff_user
      @ff_user 4 года назад

      Change
      " objects: [ModelEntity] = []"
      to
      " objects: [Entity] = []"

  • @sachinjain355
    @sachinjain355 3 года назад +1

    I am getting the following errors on line 19, please help!
    1. Extra argument 'minimumBounds' in call
    2. Type 'AnchoringComponent.Target' has no member 'horizontal'

    • @revernos
      @revernos 3 года назад +1

      Hello, can you make sure you have "Any iOS Device (arm64)" selected and not one of the other simulators? That should fix your issue. You could also select a real device or a generic ios device.

    • @Teemo022000
      @Teemo022000 2 года назад

      @@revernos I truly hope you will still respond mate, I believe in you:
      After changing to "Any iOS Device (arm64)", the errors disappear but I get the "A build only device cannot be used to run on this target. No supported iOS devices are available. Connect to a device to run your application or choose a simulated device as the destination." Do you by any chance know how to fix this?

    • @revernos
      @revernos 2 года назад

      @@Teemo022000 Hello! There could be several potential solutions for you.
      Does running on an iPhone X (or any simulated device) give you any errors? If not, just use that simulated device.
      Another potential simple solution could be to lower your deployment target (General -> Deployment Target), but that would only be okay if you can accept building for an less up-to-date version of iOS (if you’re planning to deploy the app you’re working on, then this isn’t a viable solution probably). This will only fix your issue if the problem is that your deployment is set to a more recent version of iOS than the device you are running the app on.
      If you do not see any simulated devices, you may need to download some.
      Here are some additional resources to help you troubleshoot:
      - stackoverflow.com/questions/33747828/a-build-only-device-cannot-be-used-to-run-this-target
      - ruclips.net/video/fmJdQKIQYqg/видео.html

  • @MycoDan
    @MycoDan 4 года назад +1

    Extra argument in AnchorEntity call

    • @PainlessProgramming
      @PainlessProgramming 4 года назад +2

      Thanks! I was getting the same error at 4:05 with AnchorEntity . appreciate the comment.

  • @DelhiTechnologyClub
    @DelhiTechnologyClub 4 года назад

    Amazing . Why not swift ui instead of storyboard?

    • @BrianAdvent
      @BrianAdvent  4 года назад +2

      Right now, I don’t see any advantages of using Swift UI in that particular case. You would have to use a UIViewRepresentable to integrate the ARView in Swift UI and some additional work with combine to pass through touch events which I find too complicated for the desired outcome.

    • @DelhiTechnologyClub
      @DelhiTechnologyClub 4 года назад

      Brian Advent ok. But I heard that swift ui is going to take the place of storyboard . Is that right?

  • @MycoDan
    @MycoDan 4 года назад

    Xcode is crashing on me after completing this app.

  • @ff_user
    @ff_user 4 года назад

    There's a little bug here where the object itself would flip if you tap on them.
    Like individual parts of the airplane flipping like crazy.
    We can workaround this by changing:
    if let card = arView.entity(at: tapLocation) {
    to
    if let card = arView.entity(at: tapLocation), card.name.isEmpty {
    (since all the models have name, but not the card)
    This way the player can *only* flip by tapping the card.
    (It gets really hard to flip the PotPlant tho 😁)
    Anyway, nice tutorial. SceneKit will be dead soon.

    • @yojay2917
      @yojay2917 2 года назад

      Nice addition!
      I find that all loaded entities names are empty, but can achieve it by assigning a name to the card.
      (When creating the cards)
      model.name = "gameCard"
      cards.append(model)
      To handle the larger objects it could be:
      if let entity = arView.entity(at: tapLocation),
      let card = entity.name == "gameCard" ? entity : entity.parent {
      So tapping the object on top rotates the card rather than just the object.
      Still a nice tutorial a year later!

  • @michaeleckl3519
    @michaeleckl3519 3 года назад

    Did anyone also have problems with: [Collision] Bad paramater (SphereRadius), value = 0.000000, passed to shape creation. ?

    • @gregbushta3086
      @gregbushta3086 3 года назад

      Where did you run into that? Do you have a line number? I did notice a problem when I first started following this video, I had to plug in my phone and select it as the build device. As I was typing the first line from the video I was getting an error: anchor = AnchorEntity(plane: .horizontal, minimumBounds: [0.2, 0.2]) . After I plugged in my phone that error went away and I was able to follow along with no trouble. My iPhone 7 is a little too old and slow to run this program with 4x4. I'm working on trying to make it 4x3.

  • @MycoDan
    @MycoDan 4 года назад

    Xcode is shit. I can not even get this app to build in the latest version. Freezes up on indexing.

    • @edinailyes7325
      @edinailyes7325 3 года назад

      Are you using a mac? because the Xcode is specifically made for apple use