| Home Page | Recent Changes | Preferences

WeaponAttachment

UT2003 :: Actor >> InventoryAttachment >> WeaponAttachment (Package: Engine)

WeaponAttachment is the class that handles the visual aspect of weapons in the third person. The two main functions used are:

UpdateHit
Used to update the properties of the attachment so the client side can correctly spawn effects.
ThirdPersonEffects
This function handles the generation of muzzle flashes, animation, tracers, ect. on the client side. Super.ThirdPersonEffects should always be called.

Discussion

Languard: For the weapons included with UT2003, the only thing this class is used for is generating sfx on the client side. In trying to design a melee combat system, I've hammered this class quite a bit, and here's what I've found so far:

  • Changing bCollideActors is not a good idea
    • Originally my thought was to use the Touch message, but this didn't work out that great. Turns out that weapon attachments, being so close to the player model, touch the player model a lot. Especialy when you run up against things. And since Touch can only get called so often...it makes for really spotty hit detection.
  • Animations
    • You can call animations on the weapon attachment from the fire classes rather easily by using xPawn(Instigator).WeaponAttachment.PlayAnim().

I hope this is what was intended for this page. Be gentle, it's my first wiki edit. :D

HaZarD.ep: I'm also working on a melee combat system. I thought about using a DoTrace() function, using the joint the attachment is attached to as StartTrace and the rotation of the weapon for the direction. The range would be long enough just to get to the end of the sword, or sth. like this. What do you think about this?

Foxpaw: I think that theres a couple of problems with using the attachment for anything authoritative:

  1. It's not going to be the in the same position on client and server, so although it would be neat in single player, the combat will seem erratic in multiplayer, as swords will go straight through a person on the client and cause no harm, or a person may completely miss on the client and still kill the person, etc.
  2. The movement on the attachment is dependant on the model and skin. Not only would you need special models for you mod (with the custom swinging animations), but your specific model could give you an advantage. For instance, models with longer arms may end up having longer reach.

What you "could" do is have all players be Karma Ragdolls all the time, and then you could pick up collisions using the Karma system as normal. This would also be very good because it would allow you to have a much more realistic response to impacts and such. However, you will have to write animations in script using impulses, and that would run very slow.


Category Class (UT2003)

The Unreal Engine Documentation Site

Wiki Community

Topic Categories

Image Uploads

Random Page

Recent Changes

Offline Wiki

Unreal Engine

Console Commands

Terminology

Mapping Topics

Mapping Lessons

UnrealEd Interface

Questions&Answers

Scripting Topics

Scripting Lessons

Making Mods

Class Tree

Questions&Answers

Modeling Topics

Questions&Answers

Log In