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"

Character leaning rotation

Hi people,

Ive been working on an endless runner type game where the player controls a bike, Ive not used a vehicle BP but instead i just used the 3rd person BP template.

Its going well so far but I'm just trying to get the bike controls to look more realistic, at the moment the bike goes forward without any input and the player is able to turn left and right to avoid incoming obstacles which is all fine. alt text But id like it so the player character (The Bike) leans left and right when turning to make it look more believable and move like a two wheeled vehicle would. Id also like the camera to lean with the player movement but ill be fine doing that when i figure out how to make the bike lean i think.

Just looking at the 3rd person character BP it looks like this part is where it controls the character turning rotation? and possibly where ill be able to control the character lean (Roll?) with some extra work.. ill keep playing around myself but so far Ive not been able to figure it out :/ alt text

Any help or a nudge in the right direction would be much appreciated :) Cheers!

Product Version: Not Selected
Tags:
bikelean1.jpg (249.9 kB)
bikelean2.jpg (298.0 kB)
more ▼

asked Aug 04 '14 at 06:45 PM in Blueprint Scripting

avatar image

Beaulamb
15 7 7 9

avatar image Pierdek Aug 04 '14 at 07:36 PM

Roll should do the trick, can You show us where this bike model has pivot?

avatar image Beaulamb Aug 04 '14 at 09:03 PM

Ok cool! do you know how i could access the Roll from 'input axis move right' node so that it rolls say 25 degrees when the direction keys are pressed?

Sure here's an image showing where the pivot is for the bike. alt text

bikelean3.jpg (184.2 kB)
avatar image Pierdek Aug 05 '14 at 06:06 AM

Ok cool! do you know how i could access the Roll from 'input axis move right' node so that it rolls say 25 degrees when the direction keys are pressed?

You have to do it yourself, try something like this: input axis right 25 degress and pass result to SetActorRotation on the roll component, but if input axis values comes instantly to 0 or 1 you should use smooth interpolation. Also you would straighten roll rotation if bike velocity is greater than 0.25 max speed.

I would move pivot to the botton of the bike, otherwise the bike roll rotation may look weird, but it's your decision.

avatar image Beaulamb Aug 05 '14 at 08:18 PM

Ok, i get what i need to do but i cant figure out how i exactly implement this in the BP :/ Ive tried to get it working but I'm just guessing really with no outcome, i can get the bike to rotate on its side but it seems to get stuck like that and only will work in one direction not leaning left and right :/ Do you know how id get started? Thanks for the reply and help :)

avatar image Beaulamb Aug 07 '14 at 09:52 PM

I'm still really stuck on this problem :( I'm a bit lost on what to do, I've tried so many options but I'm doubtful that I'm even going about it in the correct way. but also I'm unsure if its even possible with my BP because i have already put a line trace to keep the bike on the floor for going up and down ramps... which is stopping the bike character from rotating on its side :/ alt text

(to trace the floor)

bikelean4.jpg (514.0 kB)
avatar image Hardus Oct 21 '18 at 08:48 AM

Hey, Beaulamb, can you shere your project BP setup for pawn ?

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

2 answers: sort voted first

Finally! after hours of trial and error i figured out a way to get it working :D This may be a little different to anyone else that is looking for the same solution because I'm doing a line trace on the character but it may help so ill post what i did to get it working anyway :) alt text I just removed the roll stuff from the line trace as i don't really need it anyway, i then put the roll into a Var so i could alter it later. Next i simply just changed the Var with a left and right key press that went to a "set var" node and that's it! annoyed that i didn't do this earlier but i guess i didn't really have a clue.

Now my bike has some sweet left and right leaning :D alt text

bikelean7.jpg (281.2 kB)
bikelean5.jpg (334.3 kB)
more ▼

answered Aug 08 '14 at 11:37 PM

avatar image

Beaulamb
15 7 7 9

avatar image Azagwen Aug 26 '18 at 06:03 AM

I just got there, and I'm a bit confused on what was done to solve the problem ? could we get the complete process that you got through ?

(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