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 to move a child actor WITHOUT affecting the root.

In the project I am working on, I am trying to allow the player mesh to move forwards and backwards while having left and right input rotate the player around a central point. As of right now, my setup is as follows:

Root -> Spring Arm -> Static Mesh ->Box collision ->Spring arm / Camera

The root is a sphere that I am using to cause the rotation I want. That portion is working as intended. However, when it comes to movement it falls apart. I used the following BP and it caused the whole system to move forward, which throws off the "pivot point" I am trying to circle around.

Movement Blueprint

As a result, I attempted to instead use a spring arm and adjust the target arm length to offset the player from the center by using this BP setup:

Target Arm Length

It wasn't yielding any results, other than making my player get locked to 0. (It's why I put a print on it, I thought it was moving it into the distance somewhere, but instead it was throwing the actor inside the root and keeping it pinned there.) I turned off collision for the root just to see if the movement would work on the player mesh. It didn't.

Long story short, I would like to know if there's a way to move a child actor independently from the root, as I seem to be getting nowhere with spring arms. I will alternatively take a fix on the spring arm end if there is one.

Product Version: UE 4.20
Tags:
more ▼

asked Aug 16 '18 at 04:48 PM in Blueprint Scripting

avatar image

Shadowfang TC
6 2 4

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

2 answers: sort voted first

I believe simple movement input would always move the entire character with the root inclusively.
Trying to change the mesh's location relatively to the root might work.
I tried to recreate your logic, but I used a simple Float variable instead of Arm Length. The problem is this: when you launch the game, your axis input is 0. Your arm length becomes 0 right away, And then you multiply your input by 0 every time. Of course it will always be 0.
You shouldn't multiply it by your Amr Length. Try putting there some other value.

more ▼

answered Aug 16 '18 at 05:48 PM

avatar image

Tuerer
1.8k 12 7 8

avatar image Shadowfang TC Aug 16 '18 at 09:30 PM

First of all, thank you for the quick response. It was the most help I've received on a forum thus-far as well.

I tried what you stated, and it yielded a result, just not exactly what I'm looking for.

Here's what happens:

Target Arm Length Issue

I would like it to be a continuous act, based on button press, just like normal movement would be for a player. I don't want it to snap back either.

avatar image Tuerer Aug 17 '18 at 07:48 AM

Your link doesn't work =(
If you don't want it to snap back, try adding the axis value to the length, not multiplying by it.

avatar image Shadowfang TC Aug 17 '18 at 09:24 PM

Oops. I accidentally selected "private" instead of "unlisted". It should be visible now.

Anyways, I tried changing it to an addition and it still snaps, albeit a smaller distance than before. To further make sure I also removed the first multiply node and went directly from the move-forward. I then replaced the multiply node with an addition node of the same value as the initial multiply node. Both of these alterations also varied the distance of the snap, but snapped non-the-less.

avatar image Shadowfang TC Aug 17 '18 at 09:41 PM

I actually solved the issue with the BP below:

Solved!

Essentially, I needed to re-add the target arm length at the start of it, but get rid of the multiplication nodes and replace it with a single addition node.

One minor complaint is I had to crank up the scale of the inputaxis to 5 due to how slow my pawn was moving forwards and backwards. I couldn't place any nodes between the float add and set due to Unreal automatically multiplying or adding the number until it reached infinity once I hit play. I'm sure there may be another fix, but this works, and I will probably be able to blueprint edit the value anyways if I ever need to speed it up or slow it down in game.

Thanks for the help. I wouldn't have thought of the float add node anytime soon. I was under the impression it would take the value I had initially set on the target arm length (380) and use that as the starting point to multiply from. Oddly enough, when using the add, the game automatically offsets it to 380. Perhaps it's a bug.

I posted a more in depth solution below if anyone is having a similar problem.

solved.png (118.8 kB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

I initially asked this question a couple months ago on StackOverflow before I had even worked out the rotational component of what I wanted. I'll post a link to the solution there, as it goes in depth on the whole setup, to include the aforementioned rotation.

Solution on StackOverflow

more ▼

answered Aug 18 '18 at 04:21 AM

avatar image

Shadowfang TC
6 2 4

(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