Announcement

Collapse
No announcement yet.

Spawn Even if Colliding

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

  • replied
    The only thing that solves this problem is setting the Collision Preset from OverlapAllDynamic to OverlapAll

    Leave a comment:


  • replied
    If it was never working, why the heck is it even available? Just to confuse people? Why was there not even a comment at the node like CURRENTLY NOT WORKING or something?

    Leave a comment:


  • replied
    Hi everyone,

    I just wanted to provide a quick update here. This issue is one that we have been tracking internally (UE-3772). Unfortunately we do not have it corrected yet. Based on the post that PenguinTD submitted on the AnswerHub, I have updated the ticket to reflect that AnswerHub post, as well as this forum thread.

    Leave a comment:


  • replied
    Just checked on github, the related code I posted above is still exactly the same.(even comments.)
    I should post this on answer hub as sort of bug/feature request. https://answers.unrealengine.com/que...ding-flag.html

    For people who are interested in trace codes, here are relevant location:
    /Engine/Source/Runtime/Engine/Classes/Components/ShapeComponent.h Line: 237

    /Engine/Source/Runtime/Engine/Classes/Components/ShapeComponent.h Line: 32 and Line: 42

    /Engine/Source/Runtime/Engine/Private/LevelActor.cpp Line: 291(this is the starting point when you leave that check box off)
    Last edited by PenguinTD; 01-26-2015, 02:22 AM.

    Leave a comment:


  • replied
    The problem being, it's so long ago and I didn't finish the trace.
    I don't know if it's still there.

    Leave a comment:


  • replied
    Have you actually posted it as a bug on answerhub? It looks like it IS a bug, so submit it there.

    Leave a comment:


  • replied
    Is there any news on a bugfix?

    Leave a comment:


  • replied
    I agree, it's a trade off between many aspects.
    I found they sometimes tries to do a lot for you but not working as intended and just left it there for later, or something not even blip on the radar maybe cause problem.
    (like UI overhaul to use UMG because industry standard tends to just use scaleform, and lots of people getting stomped new comer or not.)

    But, it's kinda getting there, behavior tree is pretty solid now. Animation part is also solid.(render/effect are solid from the get go I think)
    Sometimes workaround are developed by people because they don't know how it works and just try to get things done, sometimes like this thread are actually doing a much better job than the potential cost if the function work as intended.
    (there are like multiple loops inside that FindTeleportLocation function)

    Leave a comment:


  • replied
    Thank you for your effort. I didn't even think to check the code. UE4 starts to be really annoying with all this workarounds for the trivial things.

    Leave a comment:


  • replied
    Can confirm it's a bug.

    Basically this is the actually checking part. bNoCollisionFail is the check box we have.
    bCollideWhenPlacing is true for Actor, and only a few like Spectator etc are set to false
    Code:
    if( !SpawnParameters.bNoCollisionFail && Template->GetRootComponent() && Template->bCollideWhenPlacing && Template->GetRootComponent()->ShouldCollideWhenPlacing() )
    {
        // Try to find a spawn position
        if ( !FindTeleportSpot(Template, NewLocation, NewRotation) )
        {
            UE_LOG(LogSpawn, Log, TEXT("SpawnActor failed because of collision at the spawn location [%s] for [%s]"), *NewLocation.ToString(), *Class->GetName() );
            return NULL;
        }
    }
    Now on a [ROOT]static mesh component, was hardcoded to return false(lol on comments):
    Code:
    virtual bool ShouldCollideWhenPlacing() const override
    {
        // Current Method of collision does not work with non-capsule shapes, enable when it works with static meshes
        // return IsCollisionEnabled() && (StaticMesh != NULL);
        return false;
    }
    on Shape(sphere/box/capsule) components:
    bShouldCollideWhenPlacing is 1 hardcoded.
    Code:
    virtual bool ShouldCollideWhenPlacing() const override
    {
    return bShouldCollideWhenPlacing || IsCollisionEnabled();
    }
    One would think that if I use a sphere/capsule shape as root component, enable collision, and that check would be usable right?
    Nope, you have to make FindTeleportSpot() return False as well. And that's a long code to trace.(I gave up half way, at that point for anyone intended to use the flag the way they wanted, may as well develop their own cheap solution.)
    The matter of fact that it tries to spawn with offset location is mind boggling, instead of just returning none when there is a collision.

    Here is my simple way to avoid spawning, it was implemented in level blueprint for quick testing, but you can manage to make it better.
    Choose the type of trace you want, usually a shape based sweep works better.
    Click image for larger version

Name:	noSpawnOnCollision.png
Views:	1
Size:	153.3 KB
ID:	1056238

    Leave a comment:


  • replied
    If this is a bug it is really old: https://answers.unrealengine.com/que...if-collid.html

    Leave a comment:


  • replied
    Click image for larger version

Name:	spawncolliding.png
Views:	1
Size:	135.8 KB
ID:	1056207

    This is in Level Blueprint.

    Edit: Cube mesh is 20x20x20.
    Last edited by E1Joe; 09-03-2014, 05:59 AM.

    Leave a comment:


  • replied
    where did you call the spawn?
    if you don't mind, show the graph as you might have hit a bug.

    Leave a comment:


  • replied
    Originally posted by PenguinTD View Post
    what happen if you offset the second one a bit but still overlap?
    It makes no difference.

    Leave a comment:


  • replied
    what happen if you offset the second one a bit but still overlap?

    Leave a comment:

Working...
X