Results 1 to 4 of 4

Thread: Can't get a Kactor to spawn via script

  1. #1

    Can't get a Kactor to spawn via script

    Hey folks. The effect I'm trying to achieve is that of a board that breaks into several pieces when destroyed by spawning different, fractured pieces in its place. For some reason, though, I can't get the Spawn() function to work. I must be doing something incredibly stupid with it, because I've been scrounging the web all night and nobody else seems to have trouble with this. Here's my code:

    class RevealKA_Board extends KActor
    var() int Health;
    event TakeDamage(int Damage, Controller EventInstigator, Vector HitLocation, Vector Momentum, class<DamageType> DamageType, optional TraceHitInfo HitInfo, optional Actor DamageCauser){
    if (Health<=0)
            //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.
    	begin object name=StaticMeshComponent0
    end object
    		Health = 25
    	bNoDelete = false
    I have verified that it will continue to perform its function after the "destroy()" command has been given with a few broadcast messages, and I have also verified that the fragment actors do, in fact, work properly. I've also tried placing the Spawn() functions elsewhere prior to destruction and changing the location. I've tried swapping out the class of the actor being spawned, and I've tried changing the extension of this class to Interpactor. I've tried using broadcast messages and an actor variable to determine the name of what's being spawned, and the only thing the broadcast spits at me is 'none'.

    I have to guess that I'm being really, incredibly dense about something and should fork over my programming badge, because this seems like a very basic thing that I shouldn't be screwing up like this. It's really embarrassing, but can anyone point out where I've gone wrong with this?

  2. #2
    maybe KActorSpawnable ?

  3. #3
    ... Yep. That did it. That did it perfectly.

    Man. I am a tool. Thank you, my friend, that was most helpful.

  4. #4
    Bump for being awesome and posting exactly what code I need to get started with physics fun stuff.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts