Download

BoneName

What am i doing wrong when i hit my actor it checks to see if it was the head or not but its giving me an error

g.png

a99ec8d6e42ed9763a76b25d47d53b6ab0878e6d.png

a9d4ab2f2aed83d3ec46a9e32ae3b67c61641049.png

FHitResult does NOT have a function called BoneName at all. However it has a member variable BoneName which you can access and use. Take another look at to documentation page, it lists the BoneName under the Variables section not the Functions section.

In your code above you probably wanted to compare the Hit.BoneName against the FName “head”. To do that (and solve the error) all you need to do is translate that to code


...
if (Hit.BoneName == TEXT("head"))
{
	...
}

P.S.: You can use


 tags to post code instead of having to take, edit and upload a screenshot everytime :)