x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

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.

alt text

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

Product Version: UE 4.7
Tags:
unreal.png (245.2 kB)
more ▼

asked Jun 02 '15 at 09:45 AM in Blueprint Scripting

avatar image

yogesh_gamer
75 22 19 24

avatar image Narghile Jun 02 '15 at 10:08 AM

Hi Mate

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?

Narg

avatar image yogesh_gamer Jun 02 '15 at 11:43 AM

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?

avatar image Narghile Jun 02 '15 at 12:19 PM

Hey Bud

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

Narg

avatar image yogesh_gamer Jun 03 '15 at 03:15 AM

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

alt text

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. alt text

unreal.png (75.5 kB)
unreal.png (620.4 kB)
avatar image Narghile Jun 03 '15 at 04:44 AM

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?

Narg

avatar image yogesh_gamer Jun 03 '15 at 05:00 AM

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.

alt text alt text alt text alt text

unreal1.png (56.7 kB)
unreal.png (54.4 kB)
unreal2.png (205.7 kB)
unreal3.png (666.8 kB)
avatar image Narghile Jun 03 '15 at 05:12 AM

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

Narg

avatar image yogesh_gamer Jun 03 '15 at 05:19 AM

Yes, Correct.

avatar image Narghile Jun 03 '15 at 05:25 AM

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.

Narg

avatar image yogesh_gamer Jun 03 '15 at 05:34 AM

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

avatar image Narghile Jun 03 '15 at 07:22 AM

HI Mate

Works fine for me in first person.

This is my code

Construction Script

alt text

Viewport

alt text

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

alt text

alt text

In Game

alt text

Narg

capture.jpg (59.0 kB)
capture.jpg (56.7 kB)
capture.jpg (96.4 kB)
capture.jpg (86.3 kB)
capture.jpg (31.3 kB)
avatar image yogesh_gamer Jun 03 '15 at 07:29 AM

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?

avatar image yogesh_gamer Jun 03 '15 at 07:38 AM

@Narghile 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. :(

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Hi Mate

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

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.

alt text

Narg

capture.jpg (32.4 kB)
more ▼

answered Jun 03 '15 at 07:50 AM

avatar image

Narghile
1.7k 74 38 110

avatar image Narghile Jun 03 '15 at 07:53 AM

I will show you.

alt text

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

Narg

capture.jpg (20.9 kB)
avatar image yogesh_gamer Jun 03 '15 at 08:11 AM

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.

avatar image Narghile Jun 03 '15 at 08:19 AM

Working on that now.

I think I have a work around.

Narg

avatar image Narghile Jun 03 '15 at 08:23 AM

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

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

alt text

Narg

capture.jpg (30.7 kB)
avatar image yogesh_gamer Jun 03 '15 at 08:28 AM

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

This Pic: https://answers.unrealengine.com/storage/temp/45074-unreal.png

While Spawn Emitter working fine.

"Add Child Actor" required transformation while "Spawn Emitter" requires "Location".

avatar image Narghile Jun 03 '15 at 08:36 AM

Transform is just Location, Scale and Rotation.

If you do not need Scale or Rotation, then all the is left is Location.

If you right click on the add child actor tranform pin, you can split it.

alt text

Narg

capture.jpg (32.1 kB)
avatar image yogesh_gamer Jun 03 '15 at 08:47 AM

Tried splitting. But not working. While Spawn Emitter is working fine. :(

alt text

unreal.png (483.7 kB)
avatar image Narghile Jun 03 '15 at 08:56 AM

I am having trouble just trying spawn child components. so not able to test what you have.

Or get your results.

So they are still spawning in the middle of no where.

Have you put a Print string off you next spawn point VAR?

Narg

avatar image yogesh_gamer Jun 03 '15 at 09:08 AM

I tried what you said with two tiles and just one pickup. And location was 530, -630, -1870, -3070, -4270. (Y Axes Only)

Looks okay. Because my floor takes 1200 units.

And my Child Actor is just a cherry which I downloaded from internet in FBX format.And create a BP based on that.

avatar image Narghile Jun 03 '15 at 09:13 AM

So for the 3 tiles that you are placing the Box Trace works correctly?

It is when you start spawning tiles is where the Box Trace Fails?

Narg

avatar image yogesh_gamer Jun 03 '15 at 09:16 AM

By the way did u noticed the difference between "Location" of Spawn Emitter and "Relative Location" of "Add Child Component"? I don't have much knowledge. Maybe you can understand this.

avatar image yogesh_gamer Jun 03 '15 at 09:17 AM

Box trace never working for me. But first even I can't spawn my pickup.

Emitter is working but not Child Component.

avatar image Narghile Jun 03 '15 at 09:21 AM

No, just did, thought it was a normal transform.

My guess would be, that it will spawn the Child with a Relative Transform.

So if you are at 500/0/0 and you set relative Transforms, and that Relative Transforms is 550/0/0 it might go to 1050/0/0, not 550/0/0.

Let me think on that one.

Just a thought.

Narg

avatar image yogesh_gamer Jun 03 '15 at 09:23 AM

Here is screenshot of box tracing.

alt text

unreal.png (1.3 MB)
avatar image yogesh_gamer Jun 03 '15 at 09:24 AM

Ya. And I can't find some other function to spawn Actor in editor.

avatar image Narghile Jun 03 '15 at 09:30 AM

Now you are spawning Cherries then blockages, correct?

Spawning can be done as above. But you would have to delete the way I did this timer.

Narg

avatar image yogesh_gamer Jun 03 '15 at 09:37 AM

Oh my god. That was my stupidity. Ya Right. I was spawning Pickup first that's why it was not working for me.

Shame on me. Anyway its my first time so its okay. :)

But what about "Relative Transform"? This is the only problem left to solve atleast for now. Is there some method to convert "Relative" to "Normal" Location?

avatar image Narghile Jun 03 '15 at 09:46 AM

What you are going to have to do is make a function.

What it will do is convert, World Location to Relative Location

Example, if World Location is 500/0/0 and you want 600/0/0, you Relative Location should be 100/0/0.

So you need to work out the first location, Find out where the next one should be in world location. Minus that and that might get you your Relative Location.

As a guess, but try that.

Narg

avatar image yogesh_gamer Jun 03 '15 at 09:56 AM

But what IF in future, I want to increase the floor size or want to move pickup location slightly?

Then I have to change everything again. Above solution might work. But this is not good solution. :(

Box Trace requires Normal Location, Spawn Child Actor requires Relative Location, if tomorrow I would like add some other function then again a new problem. :(

avatar image Narghile Jun 03 '15 at 10:01 AM

If you make the function, then could have some variables that if you change location or tile size, this could take care of it.

Narg

avatar image yogesh_gamer Jun 03 '15 at 10:53 AM

Since a floor takes 1200 units. Then I Add 2400 units, spawning two floors.

Why Add? Because moving right side, Y axes is decreasing.

But still not working. After few tiles it start spawning in space.

avatar image yogesh_gamer Jun 03 '15 at 11:07 AM

https://answers.unrealengine.com/questions/31352/how-to-convert-absolute-location-back-to-relative.html

Maybe you can understand this solution. Sounds like similar to my problem.

avatar image Narghile Jun 03 '15 at 11:34 AM

Kinda, but this is may be the other way around.

What it does is get a Transform, and a Location and turns it in to a Vector.

It might work, what you would do is get the location of the tile, Get the next transforms and it will give you a vector/location which you might be able to plug in when you break the transform

alt text

Narg

capture.jpg (18.1 kB)
avatar image Narghile Jun 03 '15 at 11:36 AM

BUT BUT BUT

This might be your thing.

alt text

Narg

capture.jpg (16.7 kB)
avatar image yogesh_gamer Jun 03 '15 at 11:44 AM

I was trying the same functions. But don't know how to convert them. I can connect "World Transform" to my "Cherry Initial Spawn" Transform but don't know about Local Transform.

avatar image Narghile Jun 03 '15 at 11:51 AM

Local Transform will be where you are spawning from.

So if you are spawning in the Tile, then the Tile would be local Transform.

If it is relative to the last Cherry, then that Cherry would be the Local Transform,

Play with both.

Narg

avatar image yogesh_gamer Jun 03 '15 at 12:05 PM

Ok. I did hit and trial. And got weird output. For few tiles, they start spawning little earlier means left side of tile. But after passing few tiles they were spawning in space again.

I set Y to -5000.

alt text

Edit: Even if I set it to -10000 then they spawn at complete left side of tile. Means left side of space and as soon my playing start passing tiles, they start spawning little right then right and so on. And finally spawn in RHS of tiles, in space.

unreal.png (217.5 kB)
avatar image Narghile Jun 03 '15 at 12:08 PM

Relative will change all the time, it can not be set.

Example

alt text

Narg

capture.jpg (23.3 kB)
avatar image yogesh_gamer Jun 03 '15 at 12:13 PM

Ok what if we do this in opposite side?

I can spawn pickups with "Relative Location" of Arrow component. But then Box Trace create problem. Is there some easy method to convert relative location to location for Box Trace?

avatar image Narghile Jun 03 '15 at 12:20 PM

For your box trace, should not be an issue as it runs off relative transforms anyhow.

So you do box trace, mix that transform of yes to the next box trace, convert to Relative and spawn there.

Narg

avatar image yogesh_gamer Jun 03 '15 at 12:29 PM

When I return "Relative Transform" then pickups spawn correctly no problem. But now Box Trace appear at first tile only. I think they are overlapping each other.

alt text

unreal.png (48.4 kB)
avatar image yogesh_gamer Jun 03 '15 at 01:09 PM

Hi @Narghile

I solved my problem. World Transformation is required for Box Tracing and Relative Location is required for Add Child Actor Component.

So I used both. World for Box Tracing and Relative for Pickups. I don't know it is good idea or bad but it solved my problem. If you have better solution you can leave a comment/answer anytime. Until then I'm using my own method. :)

Thanks for your help. :)

avatar image Narghile Jun 03 '15 at 01:14 PM

Great work

Seems like now that you explained it, make the most sense. We maybe should of worked this out ealier. LOL

Great to see you got it solve.

Will talk next time :)

Narg

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question