Understanding "Get play area transform"

Hi!

In unreal engine I want to use this node in order to spawn my actors inside of the boundaries of play area.

I return the values (location, rotation and size) spawning a cube actor, and it’s not inside my play area! Also if I start the level from a different place in my room, the cube also changes place. I need that all actors stay in a given place, no matter the possition of the VR person.

Can somebody guide me a bit, how to spawn my actors inside the boundaries of the guardian area?

Thanks a lot!

Any tips on this subject?
After connecting this node to the Event tick the rectangle is now inside the play area… but the actors … No matter what I try, the change positions when the player starts from a different place in the room.

Get play area transform isn’t really built for this job.

The better way is to get the player’s position and calculate bounds from it.

If you getting position to spawn randomly, you can use Random Point in Bounding Box.

Thanks for your answer, but I don’t understand…

If I want to spawn a given actor in the middle of the room, or in a corner, no matter the position of the player… but the player is looking very close to a wall, how can I do that??

I thought “Get play area tranform” was made for this! In Quest 2 … Now I am able to spawn an actor always in the middle, but I would like to spawn it anywhere inside of the playing area…

But if the player position changes, then the Y and X position switch … It’s a mess

How to do this consistently??

Boundary Sample for Unreal Engine | Oculus Developers

What are your conditions to spawn? Do you use NavMesh?

No NavMesh, I want to stay in a small room-size area and there’s no teletransportation.

Just place a box collision in the room, and use its parameters to spawn.

But this project will be taken to different rooms and spaces, therefore I need that it automatically adapts to the boundaries inside of the specific guardian play area of each place.

As shown in this link

https://developer.oculus.com/documentation/unreal/unreal-sample-boundary/

I can get a rectangle that fits into the guardian play area using this “Get player are transform”, but then I am struggling a lot to spawn my actors in a fixed place relative to the play area, since when the VR player moves and is in different positions, the actors are spawned in different places.

Suppose you don’t want to position the sword an absolute meter from the center of the Play Area, but rather to a location that is relative to the size of the Play Area. For example, you may have a 20 m Play Area in the X direction, and you want to position the sword half of that distance (in this case 10 m) in the X direction. You would position the sword at 0.5 x the scale of the Play Area in the X direction. You obtain this from the Transform.

That’s a condition, you need to spawn only in a safe area or anywhere in the room? Is it random? Is it specific place relative to player?

You need to tell me exactly what you need.

In different places around the playing area, but knowing where and being sure that actors will be spawned there no matter where the VR player is.

Sorry I don’t know what do you mean with “conditions to spawn”, when the player starts a given level, I just want to be sure that Actors will be spawned where I decided.

To be clear, again, Is It Random Places?

Thanks for your responses…
It’s not random, actually I want to be able to spawn my actors in given places along the play area.

Next questions.
How are you determining where to spawn?
What do you mean by play area? Is it the whole level or area around player (safe area)?

Here is everything explained:
Boundary Sample for Unreal Engine | Oculus Developers

It says to determine where to spawn to use the “Get play area transform” …

For example, you may have a 20 m Play Area in the X direction, and you want to position the sword half of that distance (in this case 10 m) in the X direction. You would position the sword at 0.5 x the scale of the Play Area in the X direction. You obtain this from the Transform.

And of course, to spawn the actors inside the safe area inside the boundaries of the guardian, where the player can interact and walk around the actors

Ok, now I see.

This documentation is about safe area so you won’t hit the wall while in VR, and the example is just to show you how to use it, Not the only way to use it. It can be used in many ways. You didn’t tell me that this is the exact thing you need (I can’t read minds). You need to clarify exactly what you need, or people won’t be able to understand you and help you.

Now to your problem, the example that you gave is overcomplicated. For that example simple forward vector with line trace would do.

Please, tell me exactly what you need. And based on that I’ll find you a solution.

I really don’t know how to explain it better really.

This “Get play area transform” gives you a rectangular shape inside the safe area. As the documentation explains, if you want to position actors or meshes or whatever inside this area, you can use “Get play area transform” to get the size of this rectangle to position (or spawn) meshes or actors inside this area in a relative position related to the the size of this rectangle.

If this is not the way to do it… how do you get a given area inside the boundaries of the guardian, and place objects in a way that they are always spawned there, no mater the position of the HMD in the when the level begins?

When you spawning something you need a point in 3D space (X,Y,Z). A boundary isn’t a point, it’s just a zone where the point might be. You are telling me about the boundary, I need a point. Where this point is sopoused to be? In the front of the player, or left, or behinde?


Here is an example to spawn actor 100 units in front of the player if it didn’t hit the wall. If did, then spawn on the wall. It can be modified to spawn a bit away from the wall.


Thanks again for your detailed support!
Unfortunately I tried this with very weird results and my actors being spawned out of the guardian boundary.

Also, I wanted to spawn or position my meshes in the space, independently where the HMD player would be placed, only related to the size of the playing area (in some rooms it can be 2x2m or in others 5x8m).

I am really bad at math and only 2 years with Unreal… so it guess I just don’t understand at all how to do this.

Can you draw an example in paint?