Results 1 to 2 of 2
  1. #1
    MSgt. Shooter Person
    Join Date
    Mar 2012
    Posts
    73

    Default Help with triggers and kactorspawnable

    Hi Folks,

    I have a really simple level where pawns can push a ball around. I want to detect if the ball is pushed outside of the central square area.
    I spawn the ball (subclass of KActorSpawnable) at the start of the level using unrealscript, and have created trigger volumes in the editor, with trigger events in kismet to capture the touch events and play a sound.

    I've been banging my head against a wall for some time now ... How do I set things up so that the ball actually fires the touch event that I set up in kismet?

    Heres my ball, the KActorSpawnable subclass:

    Code:
    Class TTBall Extends KActorSpawnable
          Placeable;
    
    Simulated Event Tick(Float DT)
    {
      //Do Gravity
      GravityForce( DT );
    }
    
    Simulated Function GravityForce( Float DeltaTime )
    {
      StaticMeshComponent.AddForce(vect(0,0,-9.8));
    }
    
    Simulated Function AddForce( Vector force )
    {
      StaticMeshComponent.AddForce(force);
    }
    
    Simulated Function SetRBLinearVelocity( vector aVelocity )
    {
      StaticMeshComponent.SetRBLinearVelocity(aVelocity);
    }
    
    DefaultProperties
    {
      Begin Object Name=StaticMeshComponent0
            StaticMesh=StaticMesh'tiki-taka.bigball'
            bNotifyRigidBodyCollision=True
            HiddenGame=False
            ScriptRigidBodyCollisionThreshold=0.001
            LightingChannels=(Dynamic=true)
    	AlwaysCheckCollision=TRUE
    	BlockZeroExtent=true
    	collideActors=true
    	
      End Object
    
      bNoEncroachCheck=false
      Components.Add(StaticMeshComponent0)
      StaticMeshComponent=StaticMeshComponent0;
      CollisionComponent=StaticMeshComponent0;
      collisionType=COLLIDE_TouchAll;
      bWakeOnLevelStart=true;
      bBlockActors = true;
      
      Physics=PHYS_RigidBody
    }
    
    simulated event PostBeginPlay()
    {
    	Super.PostBeginPlay();
    
    	StaticMeshComponent.WakeRigidBody();
    }
    Also, how would I change the shape of the trigger volume to a cuboid?

    Many thanks in advance,

    Peter

  2. #2
    MSgt. Shooter Person
    Join Date
    Mar 2012
    Posts
    73

    Default

    It seems every time I post my desperate plea for help on here I figure it out shortly afterwards .

    For anyone else struggling with a kactor or kactorspawnable and collisions/ trigger activation, your problem could be, as mine was, that you have simple box collision and or simple line collision set in the static mesh of the kactor you are trying to collide against things/ touch triggers. These simple box collisions claim to look to a physics asset to handle collisions - and I don't have a physics asset set so I presume this is why it was failing to register any collisions / triggers.
    I think I set these trying to get something to work some time ago and didn't realize it would cause me so much grief! Hope this saves someone else a lot of stress...

    Peter


 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Copyright ©2009-2011 Epic Games, Inc. All Rights Reserved.
Digital Point modules: Sphinx-based search vBulletin skin by CompletevB.com.