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"

Change Spring Arm angle not length on collision

The issue I'm running into is I would like to have the spring arm on "collision" check not to change its length but to just rotate to compensate for the collision. Then once the player moves away from the collision it should return to the default spring arm angle I have defined. Here is a picture illustrating what I'm talking about. I cant seem to get the spring arm from changing its length. Any insight would be great! alt text

Product Version: Not Selected
springarm.jpg (126.0 kB)
more ▼

asked Aug 18 '14 at 08:53 AM in Blueprint Scripting

avatar image

36 5 8 11

avatar image Duncan Dam Aug 18 '14 at 10:59 AM

I think you have to do your own spring arm with this.

avatar image OutlawIIIwolf Aug 18 '14 at 02:13 PM

Yeah I wasn't sure if I could locked that some how in blueprints. For now I have a temp solution of changing the angle before it ever can collide with any walls by using trigger volumes around the base, but its definitely not the most flexible system.

avatar image RinDreamX Aug 26 '14 at 05:21 AM

Can you share your workaround on this issue? I have similar issue with the spring arm camera but it happened when it hits the ground, then the arm get shorter and ended up clipping the pawn :( Thanks in advance.


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

1 answer: sort voted first


You might consider using a couple of Line Traces instead of collision detection. I created a basic setup using line traces that works pretty well for me, though it is certainly not perfect and could be improved upon.

Here's the Components tab of the MyCharacter BP:

alt text

Pretty standard, except I added a small Sphere component and named it CameraCollision, then attached it to the Camera and moved it down a bit.

Here's the Event Graph:

alt text

First, we set a Rotation variable based on the Camera Boom's World Rotation. This gives us an angle to return to when nothing is blocking the trace.

Then we perform our first trace, a Single Line Trace by Channel, with the Start Location of the Camera and an End Location of the Mesh component. If the trace hits something, we rotate the Camera Boom by 1 in Pitch. It will continue doing this per Tick until nothing is blocking it. This may need some additional clamping if you have a ceiling, etc.

If the first trace doesn't hit anything, it performs a second trace between the slightly lower CameraCollision component we created earlier and the Mesh. This second trace is giving us a bit of a cushion before returning the rotation to its initial position, so it doesn't jitter wildly between rotating up and rotating down.

Once the second trace is also returning false, we start rotating the Camera Boom back down to its initial rotation.

There's still some jitter with this set up that can probably be cleared up with some adjustments to the rotation speeds and positioning of the components, but you get the general idea.

Hope this helps!

more ▼

answered Sep 24 '14 at 10:48 PM

(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