Hi guys,
So I'm trying to add collision to a character for a little fight game I'm attempting to make. Basically I'm adding static meshes to the character limbs/ sockets in code that will be made invisible in future. I want to make it so that if the various parts hit whilst performing an exec function then it will register some damage to an object. I can get the static mesh spheres for the collisions in place but the problem is I cant seem to get any physics on to them. What am I doing wrong??? I'm a total noob to coding so any guidance would be really appreciated.
Getting the following warnings from compile when I try to do a collision component in the default properties.
my code is
Again, any help would be awesome, I'm proper stuck with this now!
Cheers
Matt
So I'm trying to add collision to a character for a little fight game I'm attempting to make. Basically I'm adding static meshes to the character limbs/ sockets in code that will be made invisible in future. I want to make it so that if the various parts hit whilst performing an exec function then it will register some damage to an object. I can get the static mesh spheres for the collisions in place but the problem is I cant seem to get any physics on to them. What am I doing wrong??? I'm a total noob to coding so any guidance would be really appreciated.
Getting the following warnings from compile when I try to do a collision component in the default properties.
Code:
warning, unknown property in defaults: Component.add(StaticMeshComponent) <looked in StaticMeshComponent> warning, unknown property in defaults: CollisionComponent=StaticMeshComponent<looked in StaticMeshComponent>
Code:
var StaticMeshComponent Sphere; simulated function PostBeginPlay() { super.PostBeginPlay(); Sphere = new class'StaticMeshComponent'; //making the element to attach Sphere.SetStaticMesh(StaticMesh'Monster_Mash.Sphere'); // directing to my static mesh to use Mesh.AttachComponentToSocket(Sphere, 'Right_Hand'); // where i want it to connect to //SetPhysics(PHYS_RigidBody); //Doesn't work, character sinks in to ground and gets stuck! //CollisionComponent=Sphere; //Doesn't work! //bCollideWorld = true; //Doesn't work! } defaultproperties { Begin Object Class=SkeletalMeshComponent Name=GA_SkeletalMesh SkeletalMesh=SkeletalMesh'Monster_Mash.fish_man' //character mesh AnimTreeTemplate=AnimTree'Monster_Mash.Fish_Man_Tree' // animation tree PhysicsAsset=PhysicsAsset'Monster_Mash.fish_man_Physics' // physics asset to use AnimSets(1)=AnimSet'Monster_Mash.Fish_man_anims' // animations to use Scale=1.75 End Object Mesh=GA_SkeletalMesh Components.Add(GA_SkeletalMesh) Begin Object Class=StaticMeshComponent Name=Hand_Sphere // Components.Add(StaticMeshComponent); // getting the errors here CollisionComponent=StaticMeshComponent // getting the errors here // bCollideWorld=true // bCollideActors=true // bBlockActors=true End Object }
Cheers
Matt
Comment