UE4 Turret Tutorial Part 1 - Aim at Target Regardless of Position

Поделиться
HTML-код
  • Опубликовано: 27 дек 2024

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

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

    I used your logic in C++ and it solved my 1 week waste of time on a Tank turret :) Huge thanks, Subscribed instantly after my UE4 compiled and worked flawlessly. TNX

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

      Happy to have been of help. 😁

  • @pr9039
    @pr9039 2 года назад +1

    Damn, thanks for this, you made this very simple and helped me understand some applications of ideas

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

    I have wanted to know how to do this for, no hyperbole, 3 years. I spent weeks on a project a few years back trying to work out how to do this manually before having to cheat and make one part turrets. Thanks for the simple explanation dude!

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

      Happy to be of assistance. 😁🤟

  • @mch43856
    @mch43856 3 года назад +8

    Amazing dude thank you, this is useful for an fps gun too, and thanks for implementing a screenshot of the finished stuff in your vid it's really helpful!

  • @psyco4452
    @psyco4452 Год назад +1

    O.M.G Finally xD was trying to set a get target and use a spawn actor turret and attach it to a vehicle. this method works well for that , Plus ive transfer the variable of the relatives to an mesh with bones to then make replications ( for multiplayer ) thanks man :D EDIT : couldn't set the bones angles correctly so cameback to a 3part meshes turret and it's working ! :D

  • @James-en3pl
    @James-en3pl 3 года назад +3

    Thank you so much for this series! Super helpful and I learned multiple skills with your videos.

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

      I am so happy you found my tutorials useful. 😁

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

    Great, I will try to use it to create lamps! thank you!

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

    One of the best tuts! I used FindLookatRotation before, but always had problems with its targeting :) Thx!

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

      I'm glad that my tutorial could help you. 😁

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

      What is the difference between using FindLookAtRotation and using InverseTransformDirection and Rotation from X?

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

      To be honest I'm not 100% sure but I believe it has something to do with providing the correct calculations when the turret isn't on a flat surface.

  • @85malcher
    @85malcher 10 месяцев назад

    Great stuff. It helped to solve the problem of a turret on my helicopter. Thank You!

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

    Very damn helpful, I struggled a lot with angled turrets before.
    Thanks for the tutorial.

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

      I'm glad it helped you! 😁

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

    You are my saviour, thank you man

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

      Happy to be of assistance. 😊

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

    Wonderful Job Man, thank you so much!

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

      I am happy that you found it useful. 😁

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

    This was really useful. I love you

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

      Thank you for your kind words! I'm truly happy that you found it useful. 😸

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

    That was a good tutorial, however, my turret wasn't pointing at the player location completely, it was rotating but weirdly the mesh was rotated with 90 more degrees which made him look on the left of the player.
    I found a solution in case somebody come here and got the same problem (I guess that's the good solution) :
    So I added a vector-vector of -90 to make the turret look straight into player direction. This node was placed between the break rotator and make rotator node, on the Z (in the "aim target" custom event)

    • @CrazyCatDev
      @CrazyCatDev  3 года назад +2

      From the top of my head I'd say that when imported the model wasn't facing the correct way (down the X axis). Easiest fix outside of rotating the model and re-exporting is to change the 'import rotation' Z-axis inside the model's details window in UE4 and then reimport.

  • @conneich
    @conneich 2 года назад +1

    I've been struggling with a simple aim like this for a while. Got it semi working but the forward direction was always a little off from the target. IDK about this Inverse Transfrom From Direction node before so thanks!

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

    Excellent. Thank you.

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

    Great video. Was exactly what I was looking for. I used this to create a tank turret aiming system like in WoT or WT

  • @davidchoi3766
    @davidchoi3766 11 месяцев назад

    Hi. about to go into your videos. Looks very exciting. Quick question, how hard would it be to set the turrets to aim at the mouse cursor?

    • @CrazyCatDev
      @CrazyCatDev  10 месяцев назад

      You can make the turret aim at whatever you'd like. 😊
      Could you provide a little more detail about what you'd like to do? Depending on the end goal, the process of implementing 'aim at mouse cursor' would be different.

  • @finesseandstyle
    @finesseandstyle 10 месяцев назад

    Thanks a lot this works flawlessly. I had an issue with turrets for some reason getting stuck in an opposite direction but this was because I used the set relative rotation to a static mesh a hierarchy above the BaseMesh (I have 4 static meshes instead of 3). Now I can have turrets in my space game nice!
    Also I get a subtle flickering on the turrets when they try to rotate into their target whenever my ship is moving, anyway to fix that?

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

    Awesome tutorial!!!
    Plz continue, you do well :)

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

      Thank you! Part 2 is already available and I'll be making Part 3 soon hopefully. 😊

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

    Awesome! Thanx!

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

    Thanks a lot! Very cool!!

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

    Thank You!

  • @ABadBlockA
    @ABadBlockA Год назад

    Hello, Iam pretty new to unreal. Can you tell me how you move target while level is playing? Cannot find it out anywhere. Great tutorial :)

    • @CrazyCatDev
      @CrazyCatDev  Год назад

      I run the level in Simulate mode, which allows the user to select and move objects while the game is running. Where you click the button to launch the game, there should be a drop-down menu to change it from 'Play in Editor' to 'Simulate'.

    • @ABadBlockA
      @ABadBlockA Год назад

      @@CrazyCatDev Thank you very much. Like I said - Nice tutorial

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

    Pretty cool. I wonder if its possible to make it with skeletal bones, not separated models

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

      I'd wager that it'd be possible to use a skeletal structure.

  • @RafaelBrum
    @RafaelBrum 10 месяцев назад

    Hey! What would be the best solution for a World Rotation for the platform? I want to use a world rotation instead of the Relative to aim at the target.

    • @CrazyCatDev
      @CrazyCatDev  10 месяцев назад

      Could you explain what you would be trying to achieve with that? With a better idea of that, I should be able to assist you. 😊

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

    is there a way to attach this to a third person character and make it fire at other third person characters? I'm trying to make a multiplayer game so they will have the same blueprint
    Edit: to put it simply, do you know how you can make turrets that point at the closest turret to it and fire a projectile at it without firing at itself?

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

      That shouldn't be too difficult. I'd make a function that gets all turrets within a range (example: the firing range of the turrey) and save them in an array. Then I'd remove the turret from the array using a 'find' node to find itself, so that it can't try to target itself. Next would be a function to find the nearest other turret (which I can't remember how to do off the top of my head).
      If you require this in further detail I could do a side tutorial for it perhaps.

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

      @@CrazyCatDev First, thank you for taking the time to reply to my question,
      Second, I'm honestly trying something by myself but since I'm pretty new to game development I think a tutorial with someone with great experience like you would be a great option for all the viewers and I think we can all benefit from it.

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

    Wow! It works perfectly...! How can I shoot a projectile to the target?

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

      Finally got around to it. :)
      Part 3: ruclips.net/video/Yky0ON3wPS8/видео.html

  • @tomsetberg4746
    @tomsetberg4746 2 года назад +1

    Couldn't you just get your actor location and your target location and use the function "Find Look At Rotation" and then set your relative rotation to that?

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

      That works on a very basic level, but has issues when the actor isn't on a flat plane.

  • @mervenair4026
    @mervenair4026 5 месяцев назад

    I did everything the same as in the video, only my turret is one piece, not 2 different pieces. I think I solved this problem by connecting my single piece to the nodes to which those pieces are connected. But my turret is not turning to the target, what could be the reason?

    • @CrazyCatDev
      @CrazyCatDev  5 месяцев назад

      @mervenair4026 Unfortunately, without seeing how you've got everything hooked up, I wouldn't be able to suggest any solutions. If you have Discord, feel free to add me @ unlimitedcatworks, and I can try to help you from there. 😊
      Did you try it with a multi-part turret and succeed before using your single-part turret? If not, perhaps that might be a place to start to make sure everything else is truly done correctly.

    • @mervenair4026
      @mervenair4026 5 месяцев назад +1

      @@CrazyCatDev thanksfor your attention . I will contact you on discord later.

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

    Whats the error "rotator is not compatible with static mesh component object reference

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

      If you have discord feel free to add me and we can discuss your issue there: CrazyCatDev#2583. Otherwise, could you provide me with a link to a screenshot of what nodes are causing this error?

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

    hi
    continue tutorial for ue4
    thx

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

      I do intend on it, just need to get the time to do it. 🤟

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

    Неплохой метод. Спасибо.

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

    Great tutorial! For some reason, my Turret just seems to be aiming from the wrong end of the canon. Is there a way to fix that?

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

      That is strange. Are you using your own meshes? If you are, perhaps you have exported them incorrectly? If you would like me to take a look personally I can be found on Discord @ CrazyCatDev#2583. 😊

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

      @@CrazyCatDev yeah I was using my own mesh and thanks ill hit u up there!

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

      I'm having the same issue. Did you find a fix?

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

    My canon is facing the opposite direction, any advice?

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

      You may have a node wired up the wrong way. I'd go through and make sure everything is wired up as I did in the video. Specifically the 'Find Look At Rotation' and similar nodes.

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

    So I followed this. I'm not using a base for the turret, but that shouldn't matter as much as i've attached both the pitch and yaw to the same rotator. However, it's acting like a petulant child and looking slightly away from the target. Everything is exactly the same, except the target is not a basic sphere. Again, don't know how that would affect it as much, but you never know!
    Any assistance you could provide would be great!

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

      Also, doesn't want to look up and down either.

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

      Off the top of my head; if it is looking slightly off, remember that the turret will aim for the 0,0,0 of your target actor. If the actor is slightly off axis it will appear to be aiming off.
      Regarding the up and down, all I can say is to double check all of your blueprint to make sure it is correct.
      You can contact me on Discord if you like at CrazyCatDev#2583. 😊

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

    I can not connect the variable to the get sa puts me "object reference is not compatible" you can help me
    my version is 4.24.3

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

      That error means you have either the variable set to the wrong type, or the target set to the wrong type.

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

      @@CrazyCatDev
      and how we solve this problem ?

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

      @@LaFriteDuQC If you like you can 'zip-up' your project from the 'file' menu and upload it to Google Drive or something similar and I can take a look.
      Otherwise: Can you explain in further detail what part you're trying to do? What variable are you trying to use, and what are you trying to use it on (a 'for each loop', for instance)?

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

      @@CrazyCatDev
      i'm sending you on ccdevgames@gmail.com

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

      @@LaFriteDuQC I have emailed you a response that hopefully will fix your issue. :)

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

    Thanks for the tutor. Please tell me how to aim the turret at my character? I selected my character's blueprint in the node "Get all actors of class", but it just doesn't work that way.
    P.S. Sry for my English. Google Translate

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

      If you change the GetAllActorsOfClass to your character's blueprint, you will also need to update all variables and references to also reflect that. An example is you would need to change any variables that refer to the 'Target' blueprint to your character blueprint. I hope that makes sense!

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

      @@CrazyCatDev I did something like this a little earlier, but thanks anyway for the answer.

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

      @@kostyayaskevich6920 If you have any difficulties you can always message me on Discord and I can assist you directly. 😊

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

    hm, for me it just aims at the object on the first tick and then it stops, i copied what you did in the video, what might it be?

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

      Without more information I can't accurately help you. You could zip-up your project, upload it to Dropbox or similar and email me a link?

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

      @@CrazyCatDev got it to work, thank you. Using the "Get Character controller" function on the casting caused me a few problems though (well maybe i guess cause idont know how casting works) but ideally in the tutorial you would want to use a function you can apply to any actor. So you can also make the turret shoot at lets say a random rock. (or lets say path finding ai enemies in a tower defense game)

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

      @@noji01x65 I understand what you are saying. In the way that the turrets look specifically for the 'target' blueprint I set up, you can use that 'target' blueprint as a Parent and make Children off of it (varying enemies for example) and you'd only ever have to look for the Parent blueprint and it'll at the same time check for any Children. I'll include a description of this in the next video. 👌

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

      @@CrazyCatDev Hi, after some work i managed to get the turret to shoot at a specific actor as you explained, but is there also a way to make it shoot at the class of that actor? because i made a "target" spawn and follow each of the AI path following bots, but i cannot get the turret to shoot at the target within those bots. Thank you very much, good advice.

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

      If you want to contact me via Google Hangouts, email (on my about page, hangouts also uses the same email) or a messaging program of your choice, I'd be happy to help you in real time. 😊