1. Post #1
    BastinkaLive's Avatar
    March 2009
    232 Posts
    Hey,
    I was wondering if I'd somehow parent the SENT to the owner or if I just set the position to be behind the owner?

    Which way, or maybe another way, would be the best?

    Also, do SENT's have to have models?

  2. Post #2
    Gold Member
    Skyhawk's Avatar
    July 2008
    1,541 Posts
    If you want it to be fixed behind the owner...
    sent:SetParent(ply)
    timer.Simple(0.1, function()
    local forward = ply:GetForward()*-48
    sent:SetPos(ply:GetPos + Vector(forward.x, forward.y, 0)
    end, sent, ply)

    You can replace that 0 with a z offset if you want, but you don't want it to just be ply:GetPos + forward or you'll have vertical weirdness if the player is looking up or down - you might still anyway, I think aVon or some other Lua God would probably be better with vectors.

  3. Post #3
    BastinkaLive's Avatar
    March 2009
    232 Posts
    Thanks!

  4. Post #4
    Gold Member
    Skyhawk's Avatar
    July 2008
    1,541 Posts
    local ang = Angle(0, ply:GetAngles().y, 0)
    ang = ang:Forward()*-48
    sent:SetPos(ply:GetPos + ang)

    Try that code I gave you while looking up and down (run the code to parent the sent while the player is looking up or down) and if the distance behind is different than when looking straight out, replace lines 3 and 4 of what I gave you with this. Actually, try replacing them with this anyway, I think it should be better.

    Edit: Oi, screwed it up a bit, should have been Angle(0, ply:GetAngles().y, 0) not Vector(blabla), sorry.