1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

Collisions and Blocking Mishaps

Discussion in 'Programming' started by aardvarkk, May 20, 2004.

  1. aardvarkk

    aardvarkk New Member

    Joined:
    May 7, 2004
    Messages:
    64
    Likes Received:
    0
    Running into some strange issues and was hoping somebody could clear them up...

    I'm spawning some objects in a level, and i've made sure to turn off bCollideWorld and bCollideWhenPlacing. The objects will spawn properly, but it seems like as soon as they hit a BSP, they get destroyed (or just disappear). I'm not yet certain it's the brush that is the problem...

    The objects will probably encounter other actors on their travels, and I started to get confused about whom I should be setting collide and block properties for.

    i.e.
    - What happens when a blocking actor hits a non-blocking actor?
    - What happens when a colliding actor hits a non-colliding actor?

    I'm not sure exactly why my object is being destroyed, but I thought maybe it had something to do with the fact that it's hitting a brush? I read something on the Wiki about collisions only being calculated for certain BSP Trees, and maybe this has something to do with why my object is disappearing?
     
  2. TG|Mcbain

    TG|Mcbain New Member

    Joined:
    Apr 22, 2004
    Messages:
    10
    Likes Received:
    0
    Actors witcth are "out of the world" are destroyed (exept static meshes and controllers i belive) and as you've set bcollideWorld to false your actor is "leaving the world" as soon as it collide with BSP object.
     
  3. jimboh

    jimboh Salty Sea Dog

    Joined:
    Jan 20, 2004
    Messages:
    140
    Likes Received:
    0
    What kind of actor is this? If its some actor which uses native code, that may be your problem...
     
  4. aardvarkk

    aardvarkk New Member

    Joined:
    May 7, 2004
    Messages:
    64
    Likes Received:
    0
    The actor is one that I've created called "Item" and it extends StaticMeshActor. Is there any way to make the Item not be destroyed when it "leaves the world"? I couldn't find anything in the Wiki about what conditions must apply for an object to be destroyed automatically. I found the sequence of events upon destruction, and garbage collection talked a bit about removing items when there are no more references to it and its pointers have all been destroyed.

    I thought I could solve the problem by setting bNoDelete to True, but now the objects won't spawn (I guess you can't have objects non-static and non-deleteable too?).

    Any advice?
     
  5. aardvarkk

    aardvarkk New Member

    Joined:
    May 7, 2004
    Messages:
    64
    Likes Received:
    0
    I just tried filling an array with the objects I'm spawning, in hopes that maybe by having active references to the objects they wouldn't be destroyed. No dice! Is there any way I can keep these objects from being destroyed, and why exactly ARE they being destroyed?
     
  6. jimboh

    jimboh Salty Sea Dog

    Joined:
    Jan 20, 2004
    Messages:
    140
    Likes Received:
    0
    uhh...I would avoid using StaticMesh Actor, and just use the base class Actor. For one, it is a native class, so some quirks may be hiding in the background that you may not know about, and in the long run, using the Actor class would be more flexible and easier.
    -Jimboh
     
  7. [SAS]Solid Snake

    [SAS]Solid Snake New Member

    Joined:
    Jun 7, 2002
    Messages:
    2,633
    Likes Received:
    0
    No, this has nothing to do with his problem. Think about it, the base classes are all native as well. All base classes have a certain nativity about them. Native function don't just run in the background for no reason, they have more to do with the fact that somethings just aren't possible in Unrealscript such as having non-restrictive access to outside files, so DLL's are created which are linked through Unrealscript by using native. This allows much easier module like creation for people working with the Unreal engine.

    Again, TG|McBain correctly identified that once an object leaves the world space they are destroyed. I don't think there is a way to stop this from happening.

    This won't allow dynamic spawning of an object, however it will allow you to place the actor inside UnrealED. It will let you there, but once your in the game, it can't be destroyed, hence it's label of that boolean.

    A possible fix to this, is to actually test to see if the new location is possible or not. By doing this you prevent the actor from leaving the game world. To do this, use a trace, and detect if the trace actually hits something. If it hits the world or other objects it will return with a value. If this value is equal to something then move the actor to the new location since it is possible. To find code for this, I believe the player's behindview camera checks for such things. Ideally if you could use fast trace that would be much better.
     

Share This Page