Tell me more ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I have been trying to figure out an unrealscript error lately.

Everytime I want to spawn an actor with the following default properties:

defaultproperties
{    
    bCollideActors=false
    bCollideWhenPlacing=false
    bCollideWorld=false

    Components.Add(MyLightEnvironment) // if this is missing the camera mesh will be all black


    Begin Object Class=StaticMeshComponent Name=AutomaticMeshComponent0
        StaticMesh=StaticMesh'EngineMeshes.Cube'
        bCastDynamicShadow=FALSE
        BlockRigidBody=FALSE
        bForceDirectLightMap=FALSE
        bAcceptsDynamicLights=FALSE
        bAcceptsLights=FALSE
        CastShadow=FALSE
        bUsePrecomputedShadows=FALSE
        bAcceptsStaticDecals=FALSE
        bAcceptsDynamicDecals=FALSE
        bUseAsOccluder=FALSE
        bSelectable=FALSE
        bIgnoreOwnerHidden=TRUE
        WireframeColor=(R=100,G=100,B=200,A=255)
    End Object
    AutomaticMeshComponent=AutomaticMeshComponent0
    Components.Add(AutomaticMeshComponent0)

    // Might be the cause of error
    Begin Object Class=FogVolumeConstantDensityComponent Name=FogVolumeComponent0
                Density=0.0005
                FogMaterial=Material'EngineVolumetrics.FogEnvironment.Materials.M_EV_FogEnvironment_Master_01'
    End Object
    DensityComponent=FogVolumeComponent0
    Components.Add(FogVolumeComponent0)


}

I always get the error:

appError called: Cast of DepthCamera ImprovedTestRoom.TheWorld:PersistentLevel.DepthCamera_0 to FogVolumedensityInfo failed

So, can anyone of you guys help me. Thanks, looking forward for your answers!

share|improve this question
The properties look fine as far as I can tell. The error message is simply telling you that you cannot cast an object called DepthCamera_0 to the type FogVolumedensityInfo. Are you trying to attach the component to simply a base actor class, or are you trying to attach it to another class? If only using the base actor class, the error message is either erroneous and a side effect of another issue, or more likely not located in this location. – Evan Feb 11 at 14:43
Voting to close for "debug my code for me." This would be better asked in our chat or in a discussion forum which is designed for personal assistance. We're aiming for more universal and concrete Q&A, here. :) – Trevor Powell Feb 13 at 0:09
@Evan:Yes, all I want to do is attaching the FogVolumeDensityInfo to a sensor class I created. But it just keep giving me those errors and cause my UDK to die. Trevor Powell: Kay, sorry didn't know the rules here, thanks for the advice. – Chrisma Pakha Feb 13 at 12:37

closed as too localized by Sean Middleditch, Trevor Powell, bummzack, Josh Petrie, Byte56 Feb 13 at 18:16

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, see the FAQ.

Browse other questions tagged or ask your own question.