How to add tag for My Terrain in LY 1.24?

0

How to add tag component for My Terrain in LY 1.24.0? 😕 I want detect my terrain by Raycast Script Canvas but I can not add tag to terrain, I searched a lot 🧐 but It is not possible for add my tag to terrain 😳 🏴

Is there a way to tell me? If it is not possible , IT IS BIG PROBLEM FOR MY 3D VISUALIZATION PROJECT 😭

asked 4 years ago161 views
8 Answers
0
Accepted Answer

Hi AhmadKarami,

Got some feedback from the dev team, see below.

  • on StarterGame using TerrainDataRequest
  • take a look at Gems\StarterGame\Characters\Assets\ScriptCanvas\CharacterAudio.scriptcanvas
  • in particular GetMaxSurfaceWeight, from which he can Extract Properties and get the Surface Type
  • needs to configure the terrain surface types in libs\MaterialEffects\surfacetypes.xml

Let us know if this works!

answered 4 years ago
0

---Update 01--- I did raycast on terrain without tag , result is null 😕 💔 for entities had collider, result is name entities ✅

answered 4 years ago
0

[quote="lmbr_Saulty, post:3, topic:9116"] Let us know if this works! [/quote]

Thank you 🙏 🙂 sure , I download Lumberyard 1.25.0 Tomorrow and I test soon... ✅

answered 4 years ago
0

I could be misleading here because I am not a dev, but there should only ever be one level terrain component in your hit result if terrain is hit. If all you want to know is if terrain was hit you should be able to get it by type in the result. Tags are useful when you are trying to find components/entities in a list of same components/entities.

Lmbr_Saulty's answer is the next step and will get you surface information for the properties of the terrain layers, if that is what you want.

answered 4 years ago
0

@REDACTEDUSER 1- Terrain Object The ground on which the player can walk/run(That can NOT be destroyed) 2- Terrain entities like grass, trees , etc (That can be destroyed)

This feature is an introduction to a script canvas open world game with destructibility 😉

answered 4 years ago
0

I understand. However, there is an important distinction. Although you may have entities that you logically refer to as terrain entities, the word terrain has a specific meaning in the context of Lumberyard. If refers to a type of level component, and there should only ever be one in the level.

You can test for the Legacy Terrain level component any number of ways in your RayCastHit result. A simple fast way is in the Script Canvas mentioned above, keep the terrain EntityID as a variable in the script and test for equality. You could also use the EntityID in the hit result to try to determine the type if you prefer to make the script canvas a bit more hands off.

EDIT: Maybe I didn't understand. I see you wrote "Objects on the ground that can NOT be destroyed". These are entities you call terrain objects because they sit on the ground (terrain component) and can be traversed, correct? You can differentiate these objects by giving a unique tag for objects or a property that defines whether they are destructible, and calling their destruction function when they are hit by a ray. Or you could try doing something clever with the EBus, where you send out a destruction event, but I'm not sure how performant this scenario might be if you have a lot of destructible entities.

answered 4 years ago
0

[quote="microAMZN, post:7, topic:9116"] EDIT: Maybe I didn’t understand [/quote]

@REDACTEDUSER

in unity , when you want delete/destruct trees on the terrain , It is interesting to know that terrain are also destroyed along with trees 😉 Then the player is not the ground on which to walk or run 🙂 I mean, the terrain should not be destroyed, I hope my explanation was sufficient and useful.

answered 4 years ago
0

[quote="microAMZN, post:7, topic:9116"] . I see you wrote “Objects on the ground that can NOT be destroyed”. [/quote]

Yes, of course , also you can not destroy road or river on the terrain 🙂 Unless changeable C++/Lua/Script Canvas API voxels are destroyed during the game(Edit terrain in run time game), such as a diversion of the river in a major world war, or roads being bombed in the game.

answered 4 years ago

This post is closed: Adding new answers, comments, and votes is disabled.