1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

objects attached to players?

Discussion in 'Programming' started by Chuckleberry_Finn, Mar 3, 2002.

  1. Chuckleberry_Finn

    Chuckleberry_Finn I am become Steven Seagal.

    Joined:
    Feb 25, 2002
    Messages:
    23
    Likes Received:
    0
    Hi,

    I'm trying to figure out how to spawn an object in front of the player, and have it "attached" to the player, in the sense that it moves/rotates with the player so that it's always in the same spot in front of you.

    My first thought was to modify the CTF flag code, or the shieldbelt effect code, but I can't find the part of the code in either of those classes that keeps the flag attached to the player, or keeps the shield around the player when he moves. Can anybody help me out, or point me in the right direction?

    I also noticed a thread on this board recently about creating an object that "orbits" the player, by using PrePivot. This looks promising, but I can't find PrePivot defined in the code either, so I don't really understand what it does. Any help there? :)

    Also, on different note, is it possible to spawn an object and give it the property of being world geometry? For example, weapons like the enforcer and minigun use a trace to determine what they're hitting. If they're hitting a wall (ie. "if ( traceresult == Level )" or something), it spawns the bullet ricochet spark and whatnot (HitWall i think). But is it possible to flag a non-level object with that same property, so that when you shoot it, it also spawns the spark, etc.? Or would I have to write special "HitWall" functions for the object being hit?

    Thanks.
     
    Last edited: Mar 3, 2002
  2. usaar33

    usaar33 Un1337

    Joined:
    Mar 25, 2000
    Messages:
    808
    Likes Received:
    0
    flag is held by native pawn code. Don't look there.

    Shieldbelteffect is done via the physics=phys_trailer in the defaults. This means that it trails its owner.
     
  3. aspie

    aspie It's all good baby.

    Joined:
    Feb 24, 2001
    Messages:
    315
    Likes Received:
    0
    You can code the touch() to perform only on certain items such as pawns, health, players named usaar33 and so on.
     
  4. Chuckleberry_Finn

    Chuckleberry_Finn I am become Steven Seagal.

    Joined:
    Feb 25, 2002
    Messages:
    23
    Likes Received:
    0
    That's not really what I meant. After doing some research, I don't think it's possible to give non-world objects the "level" property. For example, barrels and crates and other decorations don't respond the same way to gunfire as walls do. Try shooting a barrel with any weapon... the razor, for example, won't bounce off of it. What's worse, missiles will explode when they hit them, but won't invoke their damage functions (you can stand right next to a crate and fire missiles right at it, and you won't take any damage).

    I suppose you would have to recode all the weapons' touch functions or trace functions to deal with the special case of non-world, non-pawn objects.
     

Share This Page