Hi all, complete noob, long story short, is there an obvious way to make the knife that i throw, stick into things? im not even sure where to start, anyone got a tip?
If it is a static object, you can get the location and rotation where the object hit using a single channel line trace, destroy the thrown knife and use the hit info to spawn a new knife mesh in a stuck-in position.
If it is a character, you also need use the line trace to find out what bone you hit, and attach it to that, so it sticks in but moves around as the character runs away/falls down, etc.
Thanks Jez, cheers. (i know it wasn’t much info… didn’t actually know what to ask…)
where do i put the single channel line trace? i was just going to say im having issues getting a reference to the default scene root , (i can only get a reference to the version that takes a parameter) im looking at this video http://www.youtube.com/watch?v=yo9VrxFgUJY&t=5m13s
i was putting it on my knife… then i just started thinking i might be in the wrong place to start with.,.
edit: how do you know if its a static object? i presumed it was cause it has a StaticMeshComponent, inherits from Static Mesh Actor
In that video,… the LineTraceByChannel that he is using isnt on another object… its a tab by itself. im struggling to get the right terms here… but i cant see how the trace he is making/modifying is related to the spheres that are using the linetrace he is making.
pretty sure that bit is the missing bit in my head.
how is the tab with workflow that he is changing referencing the spheres…
omg omg i put it on me… i think i get it know. am i right?
ok i still havent got it yet… i added a sphere and went to put the linetrace on sphere just like in the vid but i havent got a reference to default scene root (like before, it just has error) so im not understanding that bit… why when i add something, it doesnt have a refence to the default scene root, i realise it must be the way im adding or what im adding but i havent clicked to it yet…
should have mentioned im in vr… i can throw the knife, just wondering wheres the linetrace coming from, the knife or me
I did this in VR,
i Just disabled physics on contact with world static objects
very simple method, but I’m sure there are many better ones
ta, good to know options. i think i need to step back a bit and beginner more. realized i dont know what im dealing with when im trying to picture those chain of events.
im in vr, i can pick up a knife, i can throw it, i want it to stick to/in things. i dont want the handle to stick into the wall, so that must mean two parts to the knife. but first things first,
i realised now that i dont know whats what… some things are meshes, some things are actors. etc.
Don’t quit it gets so much easier. Let me know if you still need help and I will post if I figure it out
Works great thanks Alpha Wolf. Basically in the BP that contains my knife or thrown object. Make an OnHit event. Tie the white arrow to a set physics enabled tab. Make sure the tick box on the bottom is unchecked. It will stick wherever it hits. I had a thrown variable that I changed when VR hands dropped it. I checked it was thrown before disabling physics to ensure it was sticking unwanted. If handle sticking try a set local rotation immediately after disabling physics