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"

"Set Actor Location" shoots player into the air

Hi! :) So here's a problem I've been stuck on for two days now and I really need your help guys :/ I'm trying to make a script using blueprints to make the player able to climb objects directly in front of him when he is in a trigger box with a certain tags. I've managed to put together the part that recognizes the tag of the trigger box and if it is correct, it let's the player press the climb button (spacebar). Then it quickly but smoothly rotates the players view so it's heading the exact same direction as the trigger box is orientated (so the player always faces the obstacle before climbing it). Then (or ideally at the same time as the view starts to rotate) the player should smoothly move upwards by the exact amount as the trigger box is tall (then the player should be moved forwards by a certain amount but I didn't get to that part yet). However here's the problem - I'm able to read the trigger box's height (tested it) and add it to the players position, however the "set actor location" function on the very right of the attached image is acting weird (now only for testing the blueprint is simplified - without any smoothing of the player's location change). The player, instead of moving upwards just the number of centimeters which equals to the trigger box's height, shoots very rapidly upwards (like 10 meters or more) as from a slingshot. Can anyone help me with this please? Thank you!! Cheers :)


Product Version: Not Selected
blueprint-1.jpg (406.6 kB)
more ▼

asked Apr 08 '15 at 09:56 PM in Blueprint Scripting

avatar image

25 6 5 8

avatar image Spiris Apr 08 '15 at 10:52 PM

I think this could be because you are setting the actor's location to increment by the z length of your actor bounds for every tick of Update on the Timeline_Rotate node.
If would recommend lerping between your position to the top of the ladder on a separate timer.

avatar image Kiwi2703 Apr 08 '15 at 10:56 PM

Thanks for the answer! This is what I was also thinking, but when I connected the "Set actor location" to the "finished" out node of the timer, the same thing happened but this time I had to press space twice. I also don't know how to make a second timer so that they could run simultaneously, since you can't split an out node into two if you know what I mean.

avatar image Spiris Apr 09 '15 at 02:08 AM

I know what you mean! I recently learned of a node that helps in situations like this. You should try the 'Sequence' node, if you use it before your timeline I think it will do what you are looking for.
It is odd that the behavior is the same when you set it to Finished... Finish should only fire once, when your timeline node finishes.
If you watch your graph while you play, does finish fire more than once per press?

avatar image Kiwi2703 Apr 09 '15 at 04:06 PM

Somehow it doesn't show me what's firing where in the blueprint, I saw videos of people using the simulation and seeing everything firing while playing but it doesn't work for me and I have no idea why... :/ Anyway, the sequence graph kinda worked, but it did it at the same time, which is good, but after the character has been moved up I need it to move forward a bit, but this has to start happening immediately after the moving up part was finished. I also need it to be smooth, every action taking 0.5 seconds (that's how my timelines work - it's linear from 0, 0 to 0.5, 1). So I attached a picture of how it looks now and it doesn't work. The player camera rotates smoothly as it should, but after that the view just jerks a bit, not moving at all, everytime I press spacebar...


avatar image Spiris Apr 09 '15 at 04:39 PM

Well, I am not entirely sure why thats happening, but as another tip, you can set up your graph to be watched after you start your game. You will see a dropdown menu just above the graph. Anything spawned during gameplay will not be selectable until you have started playing and it has spawned.
alt text

debugobject.png (41.9 kB)
avatar image Kiwi2703 Apr 09 '15 at 04:58 PM

Oh okay, it works with the object selected. Never thought of it, thanks :) Anyways I don't know what's wrong, it's firing okay... I was thinking that maybe the fact that the character is a movable physical object that is affected by gravity or something...? That it tries to move up a little bit every tick of the timeline but the physics and gravity drag it down every tick as well so it stays on the ground? Because when I remove the timeline and interpolation and leave just the "set actor location" there it works - the character instantly "jumps" to the desired position and then falls back down due to the gravity. What do you think?

avatar image Spiris Apr 09 '15 at 05:10 PM

I would say that is an excellent hypothesis. You could try changing your character's movement type to flying, or somehow counter gravity for the time you are under the effects of the Timeline node.

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

1 answer: sort voted first

Okay it looks like I was right. When I inserted "set movement mode: flying" between the sequencer and the timeline it works okay. Would you mind helping me make the "move forward a bit" part as well please? I can get a forward vector of the trigger box but I don't know how to combine it with the character location so that it moves in that direction about 30 centimeters. The thing is I can't just move the character forward relative to the character's orientation because the character will be moving forward while still rotating from the first part. I hope you understand. Thanks!!

more ▼

answered Apr 09 '15 at 05:39 PM

avatar image

25 6 5 8

avatar image Spiris Apr 09 '15 at 06:05 PM

You could try moving the character forward after rotation is complete. This question has gotten pretty out of scope as it is and due to the way answerhub works each time we comment it gets popped back up to the top of the stack.
You should close this question and open a new one when you feel you have put forward a solid amount of research into your next question.
You have a pretty solid foundation it seems, but don't forget Epic has a whole slew of tutorials and it is generally better if you put a few hours of study in and pick up a whole lot of other skills that will be useful along the way. Experimentation and expanding your knowledgebase can be very rewarding.

avatar image Kiwi2703 Apr 09 '15 at 06:08 PM

Yes, I thought you would say something like this, I also though it might be a little off-topic. Anyways, thanks for all your help!!

(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