x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Make projectile move actor (like a stake gun)?

So I've made a projectile actor that will stick to enemies when hit. Using LineTraceForObjects and AttachToComponent I can attach the projectile to the correct bone and all that.

Now, if the enemy is dead, ie it goes ragdoll/sim physics, I'm attempting to use a physics handle to grab the actor and drag it with the projectile. First problem is that to attach the projectile actor to the enemy actor, I need to use "stop movement immediately", or it will not work very well.

This translates into the situation whereby I've managed to grab the enemy actor with the physics handle, but obviously it will not move. I've tested out some set target location and rotation functionality with the physics handle, but it's not giving me any decent results, even with interp speed.

Was hoping anyone had a clue on how to get this working? Is there any way to make the projectile start moving again, after it has attached to the actor for example?

I've tried to get velocity before hitting and set velocity after but that does not produce any decent results. Also not sure how I can make the projectile stick to the wall again if I use the physics handle to move the dead enemy.

Product Version: UE 4.21
Tags:
more ▼

asked Mar 08 '19 at 07:59 PM in Using UE4

avatar image

Crowley Caine
648 8 9 15

avatar image Crowley Caine Mar 08 '19 at 08:56 PM

Slight update: Came to realize that I don't really need the projectile to attach to the body if the enemy is dead. As the enemy will attach itself to the projectile instead.

Provided I could get it moving. I don't think adding movement to the physics handle is the way to go. Simply a bypass for stopping movement by checking if the enemy is dead seems to work fine (already have that setup on enemy death as well), but I still can't get it to move with the projectile. I am grabbing a set bone on the mesh, and while it works fine as for the grabbing part, it doesn't want to move with the projectile as it carries on. And I can't grab the root component it seems...

Edit: I was able to modify the enemy chars movement by attaching the root component of the enemy to the projectile. But it doesn't work when it's dead/sim physics...

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Got it. I had to set the location of the physics handle, not the actor... Doh.

alt text

Still a bit spotty as it doesn't seem to fire the script sometimes but when it does, it works perfectly.

nail.png (69.0 kB)
more ▼

answered Mar 08 '19 at 10:47 PM

avatar image

Crowley Caine
648 8 9 15

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question