I am having a problem with decal in Unreal 4.27.2. I have set up a raytracing system for “shooting” and am spawning a emitter when the ray hit the wall and I though will I am at it I’ll set up a decal as well. The problem is, that the decal only shows up properly on some walls, on most walls it shows up as a rectangular block, and on a few walls doesn’t show up at all.
I found someone who helped with this problem on another forum.
So, far using this forum for problems, I am 0 - 4. That 0% . I guess the people who really know their stuff and could answer these questions without batting an eyelid, aren’t using these forums. With Unity wherever I had a problem I would head over to the Official Unity forum and I would always get an answer, and sometimes they went further, not only would they answer the question they would give me a complete solution with code! Fond memories.
Or the problem is that when you find the answer, you don’t post it, but instead just say “a solution exists?”
You get out what you put into it!
Separately: my guess is that the decal you apply wasn’t oriented correctly; you need to orient it correctly based on the impact normal of the hit you create.
Oh, I went looking for the solution I went through many Google searches trying to find what the solution was, some of them explaining the problem in greater detail than I had yet, none of them had a solution that worked in my project. The original problem happened last Sunday, so over 5 days looking for a solution. I was about to ditch the whole idea of having a decal altogether because it looked terrible.
And that exactly was the answer! Why didn’t you say as much before! That would’ve at least given me something more to search on even if it doesn’t tell me how to do that in code in Unreal. I know that now because as I said I have the solution.
Hit.Normal.Rotation()
Still, doesn’t change the fact that I’m still 0/4 on these forums. Mind you there have been many more questions, I would’ve liked to ask, some in much greater detail than the ones I have asked, but, haven’t because of the well, helpful, nature of this forum!
Because I didn’t see the message? There are many messages, and I personally don’t spend most of my time reading these boards.
There are also plenty of tutorials, walkthroughs, and starter projects (including on the marketplace) that show how to apply decals. There are some bullet hole decal projects I can think of right now, all of which do it right, so, worst case, you could have answered this question with a $9 purchase.
(I personally like purchasing projects just to see how other people solve problems. Sometimes, their solution isn’t great. Other times, I learn something new. A dozen dollars is super cheap education, especially compared to modern college costs in the US )
I am learning all the time I have 2 Udemy courses on the go. I have learnt heaps but they don’t always go as far as I’d like. Hence the decals problem. The ones I am doing are all offered through GameDev.tv and that is where I got the answer from after some back and forth. But even though the student assistant is an Unreal guru, who seems to know everything about everything he has a lot of work to do with students a lot less advanced than I am - he is answering many questions every day, so, I try not to bother him too much - because I really respect what he does. That is why I try here first and when it inevitably fails I run things by him and hope that it is course related enough for him to answer. Otherwise there is no answer - whereas with Unity nothing but helpful results.
Now you say, I should have looked at buying a project, now a lot of these projects are blueprint based and to be honest I know next to nothing about BluePrints, I only know C++, so the amount of assets I can buy are very limited. I really don’t have clue with BluePrint, so, I am going to do a course on that next. And I had it working, I just needed to know the one line to get it rotated correctly.
After these two courses are finished I have another that I would like to do like, the 3rd Person Ultimate Shooter, the lecturer is connected with GameDev, so, I know it ‘should’ be good. They are like super discounted @ $18 USD per course even in my currency that is an incredible price. Nothing but learning.
I’m not saying you have to buy anything, I’m just suggesting that’s what works for me!
It is true that Unreal does not focus on newly learning game developers very much – that’s not their main target. Unreal is a high-end tool, for high-end development. For example, the decal problem being “they’re oriented wrong” would be pretty obvious to anyone who has worked with projective textures in any 3D tool or engine – it’s a pretty common problem, with a pretty obvious visual cue. If what you’re looking for is crawl-to-walk level of help, then you may be right: the Unreal forums (and the Unreal engine) is more work than something that’s more tailored specifically to developers starting out.
Just a note that Decal Components are supposed to be oriented with their local +X axis facing INTO the surface you are projection onto. So you should invert the surface normal before converting it to a rotation or the projection will be backwards.
The difference may not be noticeable for decals without Normal maps, but on decals with normals, they will be inverted. I tend to use a material function to mask my decals from projecting onto backfaces.
If you wanted to be more explicit about the orientation, you can use FRotationMatrix::MakeFrom##, and optionally specify a second vector to determine the additional rotation around the projection axis.