Box Trace isn't working correctly

I’m trying to Spawn Pickup, but before spawning I do check for obstacles. If there is an obstacle then don’t spawn pickup at that location.

  1. Box Tracing For Objects shows Collision Occurs or Not correctly. But It still spawn Pickup. While I’m using Branch. If it returns true then don’t spawn anything.

  2. Since I’m trying Endless Runner game, I am spawning floor with a trigger. But Box Tracing shows those Red/Green wires for only first floor. Why it’s not working for other floors?

P.S. I’m calling “Spawn Cherries” function inside “Construction Script” of Floor Blueprint.

Edit: Problem 2 has been solved. I was using “Relative Transform” instead of “World Transform”.

Hi

Well it looks you are only returning false.

Have you Split the Pin, and maybe went to a print string so you can see what data it is pulling and eliminate it that way?

Dad,

When I use “World Transform” to get “Arrow” location then Pickups shows strange behaviour, appear in space.
Like I’m spawning 3 Tiles TTT. As soon As I cross First tile, it shows “TTTT P”
space means in space (no floor)

And When I do use “Relative Transform” then Box Trace appears for first tiles only.

How can I solve this problem?

Hey Bud

What is you initial Spawn Cherry? How do yo get that?

“Cherry Initial Point” is location of an Arrow Component from where I want to start spawning.

If I choose “World Transform” then I can see Box Tracing on all floors but no Cherry/Pickup spawning doesn’t work like it should do.

When I choose “Relative Transform” then Box Tracing appears only for first floor and cherry appear all over floor. Since I’m spawning 21 Pickups at “50” distance, in loop.

Edit: Ok, I didn’t knew the difference between World and Relative. When I select Relative transform then it spawn at same location corresponding to tile instead of new tile or “world”.
But When I use World Transform then pickups appear as shown in pic below.

  1. When something is not there I correct that. Forgot to connect “True” to set point.

  2. Checking for “World Dynamic Objects” i.e. obstacles, if an obstacle is present then just move forward. Don’t spawn anything at that place.

  3. Arrow location (Check Screenshots)

Here is everything that you need to understand my problem.

45076-unreal.png

Yes, Correct.

No problem. In meantime I will try to implement save “High Score” in a file.

So in your loop, you are checking for objects if nothing there, placing a cherry, move another 50 forward,

But if something is there, then you are not moving forward and doing box trace at same location.

What are you checking for, when you box trace?

In you picture, where is the arrow?

And all this scripting is in you tile BP, correct?

Ok, going to replicate what you have there.

I won’t spawn Blockers as they come after cherries. Got the flu, so will not be super quick.

HI

Works fine for me in first person.

This is my code

Construction Script

Viewport

Event Graph (I change to 100 before I showed in game)

In Game

45087-capture.jpg

You set “Spawn Point” variable which is of “Transform” type in construction script and using “Spawn Point Location” which is “Vector” type?

Can you please explain me?

@ My profiles shows that you did comment. But can’t see you comment anywhere. o.O Did you delete your last comment? Or some technical problem? o.O

I just cant understand your “Spawn Point Location” node. What is it?

In my scene, Pickups appears but after 3 tiles. As you know from starting, I’m spawning few tiles in advance. And when I overlap end trigger, tiles get destroyed and pickups as well because pickups are child component of floor.

How my pickups appears?

Appear on first tile but box trace doesn’t work there, 2nd tile no pickups. 3rd tile pickups appear with green box tracing, but within 2 seconds all pickups gets destroyed and then pickups start spawning at end of every 3rd floor from current floor position. It is some kind of related to world transformation. But I can’t understand it. :frowning:

Hi

Yeah, deleted one because I thought there was an error, but I forgot to plug in a node

Transform is Location, rotation and Scale,

You would not need the other 2. Just location.

I started just replicating yours, where you had Transform as First Point.

We could easily change that to Location, instead of Transform.

Works, with multiple in level.

I will show you.

45090-capture.jpg

Same node, all you do is right click on Pin and choose Split Pin.

Ok okay Nargile. I did same just like urs. Spawn Emitter and it was working.
But its not working with “Add Child Actor”. How to resolve it?

And also box tracing still not working but I can spawn fire on tiles.

Working on that now.

I think I have a work around.

Hi , this is all I did in the Cherry BP.

20 seconds after they are spawned and not picked up, they destroy them selves.

45092-capture.jpg

But this is not my problem. When I add Pickup/Cherry using “Add Child Actor Component” they spawn in space.

This Pic:

While Spawn Emitter working fine.

“Add Child Actor” required transformation while “Spawn Emitter” requires “Location”.