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"

Circular movement around location.

G'day everyone, I have another question that needs answering.

After some time messing around with different values and just giving anything a go. I've come along a method that almost gets perfect circular movement... Almost... All I need now is someone who can take a look at the Blueprint I've posted below and tell me why the character moves further away from the center rather than staying the same distance.

This is the only issue I'm currently having with the blueprint but I'm always ready to take some creative feedback on how I could improve in blueprints so even if you don't see the direct problem but see something else that might cause issues later please feel free to point it out.


BLUEPRINT: alt text

GAME START: alt text


Product Version: UE 4.17
capture.png (91.3 kB)
capture1.png (442.8 kB)
capture2.png (442.1 kB)
more ▼

asked Sep 18 '17 at 11:54 AM in Blueprint Scripting

avatar image

3 1 3 5

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

1 answer: sort voted first

I'd blame the imperfections in float precision here, they would add up over time. Could you confirm this is getting worse and worse as your micro machine spirals out of control.

Here's a couple of alternatives:

A: Stick & string - attach the static mesh to the business end of a springarm.

Rotating the Springarm in place moves the car forward/backwards. Changing Springarm length serves as "steering". Not a very flexible approach but it's robust and simple to implement and control.

B: For that semi-realistic feel, I'd create a circular spline and add a dummy target.

Accelerating would push the dummy along the spline and the car would interp it's location and rotation towards the dummy with a fairly high InterpSpeed. Steering is realised by resizing of the spline.

A bit more complicated to implement but quite flexible. If you are after a simplified driving model, you could probably skip the dummy altogether and just move the car's mesh along the spline.

more ▼

answered Sep 18 '17 at 01:00 PM

avatar image

15.2k 77 25 62

avatar image FatAussieFatBoy Sep 19 '17 at 12:26 AM

Thank you for your reply, I did some testing and I can confirm it is the imperfections of float values. As for the answers you've provided...

A: A spring arm could work in theory, I'll give it a test and post my findings.

B: I was actually just about to look into using splines... The only issue is that I can think of this method having is how complex it would become when trying to set it up from road segment to road segment since they are spawned and destroyed quite frequently.

C: Another way that I've been looking at is using Floor to flatten the value and then using Rinterp to smooth the rotation from frame to frame so it wouldn't stutter when moving at high speeds.

Thanks again for the replies. I'll post back my findings once I'm finished testing these methods.

avatar image FatAussieFatBoy Sep 19 '17 at 02:32 AM

After some testing the spring arm worked perfectly and there was no need to test the other solutions... However for people who are hoping to achieve a similar result to the image below just keep in mind that the controlled vehicle is a PAWN not CHARACTER.

CHARACTERS have an inherited parent from the C++ script where as the PAWN doesn't, meaning I can set the Spring Arm to be the PAWNS parent. This just isn't possible with CHARACTERS as the parent cannot be modified.

So to conclude this solution only works for PAWNS and not CHARACTERS.

alt text

capture3.png (512.3 kB)
avatar image Everynone Sep 19 '17 at 06:59 AM

You are talking about inheritance but to be honest, you can attach pretty much anything to everything using the following nodes:

alt text

And the rules will allow you to control the child's relative transforms. Nothing should stop you from grabbing the character reference, attaching it to a springarm component of another actor and swinging it around like there's no tomorrow. :)

Also, congrats on solving your issue!

capture.png (38.6 kB)
(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