Hello! Long time I didn't post, hope you're doing ok :)

I have a question concerning the setup required to animate an arrow flying up then down to the target in a 3D setting. I'm able to make a schematic to animate a bolt from a crossbow fly in a straight line to the target, but I don't know how to recreate the curve of an arrow.

I don't need something really sophisticated or realistic, as long as it curves at the midpoint between the shooter and the target, it'll do the job.

I have found the Curve Mode node, but I'm unsure how to use it, as it has no ''Target Position'', unlike the Change Position node.

Thank you :)
  • You don't have to use all axis on curve move. So if you do change position->target and then do a curve move for the Y axis, it'll still move to the target while following that vertical curve
    Miuratale : coming March 29 2025
    Miuratale
  • edited February 13
    Thank you for the reply!

    I tried placing a Curve Move node right after the Change Position node. Now, the arrow does the curve motion in the Y axis, but it doesn't move in X or Z and stays over the caster.

    I feel like when the Curve Move node starts, it stops the Change Position action.

    Here's my setup for both nodes:

    image

    I have also tried to have a flat curve for X and Z, but as expected, it does nothing.

    I also tried enabling ''Wait'' on the Change Position node, but as expected, the arrow flies in a straightline to the target then, once at the target, it curves upwards then down without moving in X or Z.

    Have any clue what I'm doing wrong? Thanks!
    Post edited by max_power on
  • Only one movement can be made at the same time per game object, so using another movement node will cancel the movement from the previous one.

    A better option might be using physics for this - e.g. the 3D Action RPG uses this for throwing a granade to where the player placed the cursor via a Rigidbody Change Velocity node, which calculates the velocity needed to reach the position via the Shot Velocity value.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Thank you! I've been able to get a nice curve very quickly!

    However, I have two new issues I cannot solve:

    1- By changing the speed value of the Shot Type in Velocity, I'm able to change the height of the arrow, but not the time it takes to reach the target. Right now, with a speed of 8, the arrow follows a perfect curve, but is very slow to reach the target. If I change the speed to 12, the arrow flies very high in the air, and takes the same time (I think) to reach the target. I'd like to keep the angle of 8 speed but with the arrow flying 3-4 times faster.

    2- Is there a way to make the arrow rotate during its flight? Right now, it starts parallel to the ground, pointing at its target, but remains in that angle the whole time. It'd be better if the pointy end would start pointing in the air then after a certain time, slowly rotate to point downward at its target.

    I realize making an arrow is more complex than I expected. If it's too complicated to make, it's fine, I could redesign my characters to have crossbows instead haha!

    Thanks again!
  • 1) Have you trie using Lowest or Most Direct shot type?

    2) There is an 'easy' solution for this with a change to your arrow prefab:
    - change the visible part of the arrow to a child object of the arrow prefab
    - rigidbody remains on root of the prefab
    - add a Tick Machine that starts on Fixed Update

    Now, the schematic for the tick machine simply needs to set the forward direction of the prefab's root the velocity it's moving with. There's no node for this, but can be done via the Change Fields node:
    - class origin Component
    - class name: Transform
    - click on add field
    - field name: forward
    - is property: enable
    - value type: Vector 3
    - vector3 value type: Game Object
    - object: Machine Object
    - value origin: Velocity
    - object (the component is on, i.e. not in the field settings): Machine Object

    You'll need to adjust the rotation of the child arrow on the prefab to have it point forward, so that'll depend on your model :)
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Wow, got the arrow to point in the right direction almost first try! Thanks a lot for this arrow prefab setup! (I like that you put easy inside ' ' ... it was indeed very easy to do with your instructions, but I'd never have found it alone haha!)

    As for the Rigibody Change Velocity node, I've done several tests with Lowest, Highest and Most Direct settings with different Speed values, but I can't find something that works well with an arrow. Here are my findings:

    Most Direct
    20 speed: arrow goes way too fast, almost in a straight line
    14 speed: best result I've obtained, but it feels like a shot from a crossbow (but slower), we can barely see the curve of the arrow.
    8 speed: the arrow goes too slow and doesn't go high enough. If the target is a bit far, the arrow won't reach it.
    2 speed: arrow falls at the feet of the archer

    Lowest
    Higher speed than 8: Strangely, I can't tell the difference in the arrow's movement when speed is higher than 8. A speed of 20 and 500 seem to do the same thing
    8 speed: the curve is low, and the arrow flies too slowly
    2 speed: the arrow falls at the feet of the archer

    Highest:
    20 speed: the arrow goes very high in the air and very slowly
    8 speed: the curve is very good, but the arrow flies way too slowly
    4 speed: the curve is low, but the arrow falls on the ground before reaching the target


    I haven't been able to find a sweet spot with these settings. I'd like a good curve in the arrow (Highest with 8 speed is a very good curve), but with the arrow moving like 3-4 times faster in the air. I've tried lowering the mass in the Rigidbody, but it doesn't seem to have an effect.

    (Btw, I have absolutely no understanding of how vector 3 and velocity work, so I'm just messing blindly with the settings haha!)

    Thank you for your help, I'm so much closer to having an arrow working now :)
  • edited February 16
    Well, this is physics based, so given a speed and start/end position, there's only so much this can do :)

    Velocity basically gives the thing a direction and speed (both represented in that vector 3), while gravity brings it down (e.g. if you disable Use Gravity on the rigidobdy, the arrow will keep flying in the same direction).
    Post edited by gamingislove on
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Yeah, I was thinking yesterday that my issue might be linked to the fact that my graphics aren't realistic at all. So I guess it makes that a physics based solution wouldn't 100% work on something that isn't physically logical...

    That's fine, I'll figure something with what you have helped me build, it's already so much better than what I had. Thanks again :)
Sign In or Register to comment.