Download

How do I Rotate components by joystick input at different rotation rates?

So this is an odd thing to need…

I need two components to be rotated by the joystick, while having independent rotation rates as they do it.

You can change the rotation rate of the player in the Third Person Project, which is how fast the capsule faces the direction of your left analog stick.
I need to create this exact behavior, for a separate component which has its own rotation rate dependent on the joystick in the same character, like another capsule.

Why:
I have features that require instantaneous rotation of the component to match the joystick (tilt with the analog to face a direction, and continue facing it until you tilt to another direction)
BUT, these features must be separate from the current rotation rate of the character capsule because that is used to to turn the player character smoothly, I need these components to have independent rotation rates, while still being controlled by the joystick.

Thoughts?

Use this http://imgur.com/QidSjQW . Separate out the inputs instead of using one make rotator. Then you will need to create a float variable with appropriate name and attach to float/float . This will allow you to change speeds.

Wow, that looks like it would work, but how did you get “pitch”, “roll”, and “turn” input axis nodes, are they custom events?

Nope just axis inputs (So if your using an xbox controller you can use your left stick for turn and move forward and right for up and down, if you don’t know how that works let me know and I’ll point you in right direction). That’s what I named my Pitch, Roll and Yaw. I have a more advance one where you can set rotation limits but it’s buggy still. Hopefully I will have it working this week.

Also remember when working with axis inputs each axis used in different ways needs a different name. For instance you would name one “Mesh Yaw” and another “Camera Yaw”. My dragon has a movement setting a weapon setting and a camera setting all using X,Y,Z axis so there are three different Input labels for each axis a total of 7 labels because the camera and weapon don’t roll but pitch and yaw only the dragon rolls.

@PropagandaWar

I’m running into an extra issue because my pawn uses “Orient Rotation to Movement” which targets player movement component.
The behavior that’s created by using this setting is what I’m trying to replicate on another capsule component, which I can use a separate “Rotation Rate” for it.

Can you send me an image link of both the blueprint and the work. If you want to send it privately just send it to jamessutterlinbts@yahoo.com. I have multiple things running under one capsule rider movement will be added later. Here is my game. work. I just want to make sure we are talking about the same thing: The lance and dragon both move separately. here’s some of my testing footage to see if we are on the same page https://www.youtube.com/watch?v=PSaUsgU2P-Y

Yeah I’ll prepare a file, one moment :slight_smile:

@PropagandaWar

Ok here is the link:

I gutted out all the various attempts I made that failed so the BP would be clean and readable. It’s just the TPP with additional components.

Cool. I’ll look at when I get home. It’ll be few hours.

I have it open. Before I do anything I want to make sure you want your targeter to be able to rotate on its own. Example. Left thumbstick on xbox controller to move right stick to aim. Or WASD to Move Mouse to aim? Because the first thing I see is they should both be separated. Which I’ll do once I confirm.

good news Is I broke it. For some reason it wants to make that static mesh just stay put. Lets see if we can fix it. I created it’s own input. Hopefully I can get it going then you can work your more advanced magic.

well I got it to rotate. Problem was on its own. I don’t think the way I have been doing things likes the way you do things. I’ll try again tomorrow.

Well I want it to rotate with WASD.

It’s suppose to move just like the pawn does, only it should do it instantly.

Thank you so much for taking time to help me with this :smiley:

No problem. I only hope that I can help. I’ve noticed that if you program your move functions one way other functions don’t want to work if they follow different settings. What I did should have worked fine. What I am doing with you is helping me as well. I’m studying some vector and torque stuff tonight and going to see if that works better in both yours and mine application. If I break my lance my theory will be confirmed as I will be using both the vector and local settings.

@PropagandaWar

Hey this set up is “almost” working.
LocalAim01.jpg

The only problem is that the targeter snaps back to it’s original rotation when the analog stick is neutral.

What it should do instead, is persist in pointing in the direction it was looking at.
But it’s so close, but I feel that there has to be a simpler way to handle this, if only we could see how the UE4 devs made these properties for the parent class.

The BP:

CAREFUL! LONG TEXT!

[spoiler]

[/SPOILER]

Put a Float*Float between your break rot at the end of the script. Add a float/float. Then two varibles turn and speed attach to the division float. See if that helps. If not do a float - between input and break rot and a Float + between Make Rot and make vector. I think it’s snapping back because the get control has no value to associate with, but I would try the others first then mess with that one. I of course could be and probably am way off.

I thought you could open up the code to see what the parent class looks like (I can barely read code,but getting better. My friend told me to stay away from it for now because he wants to see what i can do just with the script. Besides he’s been coding for over 20 years any hitches he’ll handle). I just get stuff to work then just take the next logical step and start breaking stuff. Just like how I want my dragon to turn 90degrees max. Pitch and yaw can stay true so I add the clamp to the roll then tie it into the rest of the movement and nothing. It wont work. Separate it then the roll only works. That’s why I’m switching over to vector movement.

@PropagandaWar

What values should “turn” and “speed” be, are they suppose to be set by something?

I would set them to 45 like the rest. It should effect the rotation rate. you may end up adding more or less.

Did you have any luck?