Announcement

Collapse
No announcement yet.

No collision When changing StaticMesh ingame?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    No collision When changing StaticMesh ingame?

    Hello Community,
    I'm currently trying to change some Meshes in game. And that's working fine for now. The only problem is, these objects have no collision.
    I added a convex collision to the StaticMeshs Objects in the Browser. Then I change the mesh to one of these, they don't have collision.

    Here's the script I'm using:
    Code:
    class ObjectOverTime extends Actor
        placeable;
    
    var() instanced StaticMeshComponent MeshComp;
    var() StaticMesh Dimension1;
    var() StaticMesh Dimension2;
    var TimeField TF;
    
    function UpdateDimension() {
        local float dist;
        ForEach DynamicActors(class'TimeField',TF) { //my One
            dist = VSize(TF.Location - Location);
            if(dist <= 512) {
                MeshComp.SetStaticMesh(Dimension2);
            }
            else {
                MeshComp.SetStaticMesh(Dimension1);
            }
        }
    }
    
    defaultproperties
    {
        Begin Object class=StaticMeshComponent Name=Mesh1
    		CastShadow=true
    		StaticMesh=StaticMesh'RoboPlaneten.Sofa' //Placeholder
    		bAllowAmbientOcclusion=true
    		CollideActors=True
    	End Object
    	MeshComp=Mesh1
    	Components.Add(Mesh1)
    }
    Can anybody help?

    Thanks,
    Voleuro

    #2
    I don't see any collision settings for the actor itself.

    Code:
    DefaultProperties
    {
        bCollideActors = true
        bBlockActors = true // if you also need blocking
    }

    Comment


      #3
      Oh.. o.O
      Now it's working. Sorry for the silly question..
      And thanks.

      Voleuro

      Comment

      Working...
      X