objects attached to players?

  • 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.

Chuckleberry_Finn

I am become Steven Seagal.
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:

aspie

It's all good baby.
Feb 24, 2001
315
0
0
40
Australia
You can code the touch() to perform only on certain items such as pawns, health, players named usaar33 and so on.
 

Chuckleberry_Finn

I am become Steven Seagal.
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.