This one should be fairly simple,
but I can’t seem to figure it out.
So to keep things simple…
I have a blueprint which has a static mesh (with collision setup directly onto static mesh) as a component as well as a trigger volume and behavior.
I also set mesh’s collision within Blueprint to “BlockAll”.
So… if I place an instance of BP into world/level and I play same. My character collides and cannot walk through it.
And my problem arises in following scenario…
character can spawn objects and place them onto map.
So a key is pressed and an object is placed in front of him. (an instance of BP explained above)
problem is that now, player walks through it… what happens to collision box?
I even tried to call function : Set Actor Enable Collision : but that does not solve my problem.
Why is it that when I directly place an instance of BP onto map collision is there,
but when player dynamically spawns it in, collision is no longer valid / present?
I just double checked.
I am spawning BLUEPRINT and not mesh.
Any other theories?
It kinda snaps / blocks for a split second and then player walks right through.
Whereas if i place it manually, it completely blocks and I cannot walk through it.
I’ve set up a project that does this and didn’t have any problems with collision, so I’d like to go through my setup step by step and we’ll see where yours differs from mine.
First, I set up my object Blueprint. I used a SceneComponent as root, and I have a chair mesh (SM_Chair, from Starter Content, though it shouldn’t matter what mesh you use) attached to it. Root has no collision, and Static Mesh is set to Block All. In EventGraph, I have an Event Tick node with a simple Add Local Rotation of 4.0 on Z axis for Static Mesh. This just rotates chair indefinitely.
Next in my Player Controller, I created a Spawn Object function with a class ‘Actor’ input. This function uses a Spawn Actor from Class node, takes input I gave it and a Transform in front of character. When I call function, I pass it that Blueprint class I created earlier in first step.
That basic functionality works as intended. So if yours is doing something different, we need to see which difference is causing collision to not work. If you set up something as basic as this, does it work in your project?
Blueprint:
Root → static mesh w/collision setup (set to block all)
Attachment → trigger volume (no collision)
Player Controller:
I don’t understand, because when I place a copy of BP into world manually… it works. But when player spawns it in, it doesn’t.
I don’t mess with any of collision nodes inside of Blueprint. What could be causing this?
We haven’t heard back from you in awhile, so I am marking this post as resolved for tracking purposes. If you are still experiencing this issue, please provide information and .uasset for your Blueprint as requested below. Thanks!