Skyrim

If you're crouched on a ridge and try to shoot an arrow downward off that ridge, your arrow may teleport backward and impact the ground beneath your feet. Why does this occur, and how did I fix it?

When you attempt to fire an arrow, the game needs to know where to spawn that arrow. Skyrim is programmed to find the WEAPON node in your animation skeleton -- sort of like an invisible limb that happens to be positioned a few inches in front of the tip of your bow -- and spawn the arrow there. There's a bit of a problem, though: your animations aren't physics-based. This means that if you were to walk up to a wall and try to shoot an arrow at it, the WEAPON node would be on the other side; the arrow would spawn on the other side and you'd effectively be able to shoot through walls.

To prevent this, Bethesda does a raycast for the first few frames of an arrow's flight: they draw a line from your position to the arrow's position. If that line hits anything, then the arrow is moved to the hit position, where it'll collide and bounce away. But... what is your position? And what is your arrow's position?

Well, your position is a single point in space located directly between your feet, on the ground you're standing on. The arrow's position is its tip. The picture below should make it quite clear why this is a problem.



That's my test character standing on the cliff near Markarth's guard tower, firing down into the marketplace. The cliff she's standing on is outlined in red. I drew a blue line to represent the raycast from her position to the arrow's position; as you can see, that line intersects the cliff. This means that in the vanilla game, the arrow would spawn in front of her bow and then, on the first frame of its existence, immediately teleport backward beneath her feet and impact the cliff she's standing on.

The fix is relatively simple: I changed the raycast so that instead of going from a character's feet, it goes from roughly their center of mass. This still allows us to accurately prevent you from shooting through walls, without creating false-positives when you shoot downward off a ridge.

Article information

Added on

Edited on

Written by

DavidJCobb

22 comments

  1. Warrenicus
    Warrenicus
    • premium
    • 0 kudos
    Instead of the arrow being centred from your body mass, would it be possible to instead centre it from your hand? Which hand should not make any difference.
  2. FerasekKoorich
    FerasekKoorich
    • member
    • 0 kudos
    It doesn't seem to be working for me. I downloaded the mod specifically to fix this issue, but it doesn't seem to have made any difference at all. Can someone help me, please?
  3. GzillaMan
    GzillaMan
    • member
    • 0 kudos
    I wish someone would port this to Xbox. I love being an archer, and not being able to snipe from above is maddening.
  4. Nanos20
    Nanos20
    • member
    • 0 kudos
    Thank you for your explanation. After using your mod in the game, it did work.
    but
    After the latest reinstallation of my game and Mod, I noticed a situation.
    if my character is standing on the left side of a wooden pillar(or a stone wall)and close to it, when I shoot an arrow, most of the time the arrow will be spawned in the correct location, but sometime the arrow may shoot out from the right side of the pillar.
    If my character is on the right side , the arrow may spawned from the left side of the pillar.

    Perhaps, I guess, the program misjudged the location of the weapon node, and then the arrow spawned on the other side....

    before using this mod, this situation exists in my game, but I didn't notice it

    the other thing that bothers me is when the arrow‘s spawning location is misjudged. then, the arrow is to be spawned from the other side , but the spawning location is not certain. It may fly out from a position very close to the pillar, or shoot directly to this pillar, or may be the arrow will be spawned at a location where we cannot even see——out of current scene, inside the nearby wall for one

    The only thing I can be sure of is that if I draw a straight line perpendicular to the direction of aiming, the arrow must be spawned on the straight line, and the direction of shooting is parallel to the direction of aiming. but the distance between the arrow and the character seems to be random

    What can I do to solve this problem ?
    1. DavidJCobb
      DavidJCobb
      • premium
      • 366 kudos
      I'm having a hard time visualizing the scenario you're describing; among other things, I'm not sure what angle you're aiming at relative to the pillar, and I'm not sure of the meaning of the arrow "shooting out" from the right side of the pillar (i.e. whether it's deflecting off of the pillar or literally shooting out of the pillar). Can you get me a picture or a video?

      If the arrow is deflecting off of the pillar (and this could include it deflecting off of the pillar while technically being inside of the pillar), then the situation could be related to the downward-aiming bug. There isn't really anything you would be able to do about it; the fix would involve hacking the game engine (in the same manner I did) and adjusting the logic for how the game tests the trajectory of the arrow at the time that it is fired... but I'm not sure what more one could change, with me correcting the raycast height.

      (Hm... Thinking about this some more, the WEAPON node is in front of the player but it's not dead-center. Depending on what you're lined up with and how, maybe that's a problem -- us raycasting from dead-center to the WEAPON node, such that the raycast is happening at a slight angle from the direction the player is facing. If that's the issue, we could perhaps use some basic trigonometry to offset the raycast position along the player's cross axis (i.e. "left/right") to match the WEAPON node's cross-axis offset, such that our raycast vector is exactly parallel to the player's main axis (i.e. "forward/backward"). Not sure I have the time to work on this right now -- I"m busy making some tools for modding the game -- but it's an idea to consider. Still -- can't say for certain whether this might help until I see your situation occurring myself.)

      (EDIT: Diagram of the last paragraph, to aid my memory.)
    2. Nanos20
      Nanos20
      • member
      • 0 kudos
      I don't know how to send you images directly,
      https://www.nexusmods.com/skyrim/users/76743388
    3. RoboJasonMan
      RoboJasonMan
      • member
      • 4 kudos
      Might be simpler to use vector math here than trigonometry. If you have a unit vector for the player's main axis (forward/backward), then just take the dot product of the PLAYER-to-WEAPON Node vector with this unit vector. That gives you the magnitude. The unit vector itself gives you the direction. The unit vector times the magnitude gives you how much to offset from the WEAPON node, i.e. subtract the vector coordinates from the WEAPON node coordinates to get the "Raycast Origin" position.
      Vector diagram
  5. artyfarty
    artyfarty
    • member
    • 0 kudos
    Oh thank you so much! It's gone! This mod is hard to find and underrated.
  6. RAHelios
    RAHelios
    • member
    • 0 kudos
    Does this fix the problem when you in a sneak position shooting the arrow and it just falls straight down on the ground???
  7. Merovign
    Merovign
    • supporter
    • 2 kudos
    I haven't even tested this yet but OH THANK GOD! This is SUCH an annoying bug!

    I had a skeleton adjustment years back but some update broke it as a fix.

    (looks back at years-old Skyrim installation with 240 mods) Oh dear. Work ahead it seems.
  8. adjustedfocus
    adjustedfocus
    • premium
    • 2 kudos
    Hello! Thank you for this thorough explaining! I've had this issue since PS3 and PS4. Now that I'm on PC, I believe this issue is a lot easier to fix.

    I'm on Skyrim SE so I want to know how can a noob like me fix this? What was the process of altering the raycast? Is is compatible with this AIM Fix mod: https://www.nexusmods.com/skyrimspecialedition/mods/18524 ?

    Thank you again for your help!
    1. DavidJCobb
      DavidJCobb
      • premium
      • 366 kudos
      SSE Engine Fixes has a ported version of my aiming fix.
    2. Dejnov
      Dejnov
      • premium
      • 0 kudos
      Is there a possibility of you releasing your arrow aim fix for Special Edition without being packaged with the SSE Engine Fixes mod? All I see in the comments files is a lot of discussion on how things are complicated and broken. I'd rather just have your fix as a stand-alone mod if possible.


      Dejnov.
  9. 5133p39
    5133p39
    • premium
    • 167 kudos
    You specifically mentioned the problem occurs in 3rd person view, but i think it happens in 1st person too (and it is reasonable to expect the way how it works doesn't change between 1st and 3rd person views).
    Well... i can't say the cause for what happens is the same, but it fits the description perfectly.

    I usually encounter this problem, when going through the early stage of the game where you are sent by Jarl of Whiterun to fight your first dragon at the watchtower.
    I always go on top of the watchtower, let the dragon start fighting the soldiers on the ground, and i shoot arrows at it from top of the tower.
    Depending on position of the dragon, i often have to jump on top of the rampart to work around what seems to be exactly this problem.

    So, here is hoping your fix will work for this problem in 1st person too.
    In any case, thank you very much for this.
    1. brianj64
      brianj64
      • supporter
      • 2 kudos
      I don't think this is true. 1st person view is it's own separate entity, UNLESS you are using a mod that allows you to see your body underneath you, which basically makes first person a camera attach to your face on third person model. You can notice this when you're standing near a collision, if you change to third person, you can sometimes see how the game tries to correct your positioning by slowly pushing you away from that collision once you leave 1st person.

      Also I think that arrows spawn differently in 1st person, because otherwise some really weird arrow teleporting or rubberbanding would happen when you fire a bow, since the bow is technically floating in the air, unlike it is in third person.
    2. Abbakab
      Abbakab
      • premium
      • 0 kudos
      I've experienced exactly the same thing as 5133p39 when firing arrows in first-person (one of the few things I generally use first-person view for, actually). Arrows definitely bounce off ledges etc. when firing downward from a wall or cliff even though there appears to be a clear line of fire to the target. I'll try to test this after upgrading to SSE Engine Fixes v4.4 (it was that mod's changelog page that led me here).
    3. DavidJCobb
      DavidJCobb
      • premium
      • 366 kudos
      Article's been updated.

      Based on the code I saw, nothing relevant changes between first- and third-person. Your position is the same value for both, and in both cases, the game uses the "WEAPON" node in your animation skeleton as the spawn location for the arrow. I specified third-person originally because the bug feels more obvious to me in that mode.
    4. SC00BIESD00BIES
      SC00BIESD00BIES
      • member
      • 0 kudos
      it happens in 1st also I hate it so good
  10. broccolimonster
    broccolimonster
    • member
    • 13 kudos
    this also affects spells?
    1. brianj64
      brianj64
      • supporter
      • 2 kudos
      AFAIK It will affect spells that use the same projectile logic as arrows.