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"

How move an Actor againts the player using a Timeline?

Hi there! The player is a hammer, and it smashes the nail in front of him. The nail comes back at its position after 2 secondes. EXCEPT if the player steps on it, the nail doesn't come back. Can you solve this mystery? It would be very much appreciated!

Here is my blueprint of my nail : alt text

And here is a video of the problem : https://youtu.be/8PxE6Z8hgZY

Thanks for any tips!

Product Version: UE 4.21
Tags:
help.png (281.5 kB)
more ▼

asked Jan 16 '19 at 12:29 AM in Blueprint Scripting

avatar image

YourBoiCasey
5 1 2

avatar image ThompsonN13 Jan 16 '19 at 02:02 AM

im not sure on your particular issue but i personally wouldnt be using relative location the way you currently are since you are moving the root component. you could leave your script as is using relative and add in a scene component as the root. i know you can end up with odd behavior when trying to move the root via relative.

avatar image YourBoiCasey Jan 16 '19 at 02:12 AM

What I want is the nail coming back to its position EVENTHOUGH the hammer is on it. But here, the nail just stop moving if I step on it.

Could you explain more what should I do? I don't understand the root.. What is a scene component as root? Thanks for your thought!

avatar image ThompsonN13 Jan 16 '19 at 03:12 AM

well i may have found at least part of your issue here, your setting your is nailed variable to false as soon as you begin your timeline. this could in theory affect how your location is set, or rather it could set your location several times which would in turn mess up your calculation. to fix that part of the issue move your set isNailed to the finished pin of the timeline, that way you can only hit it again once the timeline is done.

as for the root bit, the root of an actor is the component that all the others are based on in a way. it is the piece that all other pieces are connected to, or put another way its the base level of the heirarchy. the root is also therefore the origin of the actor so all relative locations are based off of its location. a scene component is basically a dummy component, it doesnt get rendered but it still has information like location scale etc. by using a scene as the root you basically have a set point of reference for the origin that you can base the movement of other components on. how this applies for your example is that you could use a lerp vector instead of a ease and you can move between two set locations instead of having to get a location and set a variable. this would allow you to place the actor and move the nail say 80uu in the -z quite easily.

alt text

capture.png (255.8 kB)
avatar image YourBoiCasey Jan 16 '19 at 03:59 AM

So:

1- The part about the Is nailed didn't seem to change anything. But I will keep the way you said!

2- For the root, now I understand, thank you very much for that! One thing I don't understand is how I can apply this to my problem. I see why I should use the lerp, but what is the "new variable"? And how should I use the root for my nail to move to a certain point? Do I make a scene component in the viewport and position it where I would like the nail to go. Then Get the location of that scene component and tell the nail to go there in the lerp?

Thanks for your time, it is really appreciated!

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

3 answers: sort voted first

have you tried turning off collision or ignoring them under collision presets change the default alt text

untitled.png (361.5 kB)
more ▼

answered Jan 16 '19 at 04:48 AM

avatar image

dabs863
156 1 3 6

avatar image YourBoiCasey Jan 17 '19 at 04:38 PM

I tried to change my collision preset, and even with Ignore all, if I step on it, it won't come back.

BUT, I tested something : If I pull it in the air, and jump on it without even hit it, it goes does, through the floor and it stops there because I can't touch it anymore. So I disabled the gravity, but it continues to drop down.

I believe my character have some weight or something repelling my nail...

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

So little update for what it is worth : The problem ONLY occurs when the nail is doing movements (upward, downward). If I step on it while it is stand still, no problem. So I guess the problem is in the timeline. Here are some images alt text

wow.png (40.1 kB)
helpe.png (108.6 kB)
more ▼

answered Jan 17 '19 at 07:52 PM

avatar image

YourBoiCasey
5 1 2

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

Sorry for the spam, but I think I got it! I played in the collision preset, choose Custom, check Ignore all except WorldDynamic and it works! Here are my settings for now on. alt text

Thanks to Dabs863 for the tip! :)

collision.png (34.2 kB)
more ▼

answered Jan 17 '19 at 08:01 PM

avatar image

YourBoiCasey
5 1 2

avatar image dabs863 Jan 17 '19 at 08:49 PM

hey glad it worked :) it helped me so i figured i would put it out there

(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