Hi, i'm trying to figure out how constraints work in UDK. Have looked arround for a few days about attaching a kactor to my pawn, but what i find is mostly kismet, which i prefer to avoid by this moment.
Then i found refferences to rb_constraints and its familly, but not much about using them on US. Finally i found this:
http://udn.epicgames.com/Three/Whizz...nDocument.html
It seems simple enought, so i tried to use that example and make my code. This is the result:
Well, ultimoHit is my Custom Kactor wich is, simply a box:Code:// Spawn the Constraint CharacterConstraint = Spawn(class'RB_ConstraintActorSpawnable',self,,pawn.Location); // Don't allow any twisting around, we will handle rotation manually later on if we want the character to rotate while moving CharacterConstraint.ConstraintSetup.bSwingLimited = true; CharacterConstraint.ConstraintSetup.bTwistLimited = true; // Initialize the constraint between the character and the AquaBall on the bone 'b_Head' CharacterConstraint.InitConstraint(Pawn,GlossPawn(pawn).ultimoHit,'b_Head'); //tried also with the gun socket
but when i call the function, the box randomly flyes on any direction pretty fast. If you can touch it again and launch the grab function, it agains go away flying in other direcion or simply dissapears. Cant understand whats happening here.Code:class kActorBase extends KActorSpawnable placeable; var() int Health; event TakeDamage(int Damage, Controller EventInstigator, Vector HitLocation, Vector Momentum, class<DamageType> DamageType, optional TraceHitInfo HitInfo, optional Actor DamageCauser){ local int i; super.TakeDamage(Damage,EventInstigator,HitLocation,Momentum,DamageType,HitInfo,DamageCauser); Health=Health-Damage; if (Health<=0) { for(i=0; i<20; i++) { Spawn(class'fragment', , ,HitLocation); } Destroy(); //For frame of reference, these are simply KActors that have had a mesh component pre-selected in script and are pre-set to awake on start. } } DefaultProperties { begin object name=StaticMeshComponent0 StaticMesh=StaticMesh'LT_Mech.SM.Mesh.S_LT_Mech_SM_Cratebox02a' end object Components.Add(StaticMeshComponent0) Health = 100 bDamageAppliesImpulse=false bNoDelete = false bWakeOnLevelStart=true bCollideWorld=true }
¿Any idea on this? Is there any scripting refferences to go a little deeper into understanding US way of constraints?
Thanks



Reply With Quote

Bookmarks