The code for creating the code, the user event code and calling the code is depicted above. But in the game, the widget is always spawned a world location 0,0. Can someone please help me.
Instead of Render Translation, set the position in the viewport directly:
If you do not provide a value, it will default to screen location 0,0.
The animation could use Render Translation in order to nudge the widget around.
Add to viewport first, only then Set Position
. I’ve updated the image to avoid confusion, my bad.
Also, ensure the widget has no canvas, as this could offset any hierarchy.
You’re making something similar to:
Right?
@Everynone, I found the error and thought of sharing it with you, who were so kind to respond.
You can see in the image above that I am taking the impact location from the impact point, whereas previously I had taken it from the Impact normal (which is not visible in the image I shared). Now all is OK. I only changed that, and everything else is as you see above.
Thank you for your kindness.
This is the code with the complete function.
No probs.
Not sure if relevant but for future reference, in case you did not know, UE has an interface based native damage system:
Which can also be further extended with Damage Type classes. Perhaps there’s no need to re-invent the wheel.
Good luck!
@Everynone! I didn’t know that! So how would one go about doing that? Can I add damage per bone?
Oh yeah, have a look at thread:
@Everynone, That’s really great! Would you share that, please?
Look at the thread. Everything is there, the entire project is attached.
The numbers have to spawn at the hit location on the body. That’s why I used render translation. I will try what you suggest. Is doing render translation more expensive than what you suggest?