chaos vehicle clutch to neutral to current gear BP? Need help

hi guys, i have a chaos vehicle, with a manual transmission, i have set all gears with action mappings already, however what im struggling with is the clutch, i do get the vehicle to go into neutral gear0 when clutch key is pressed however if i hold down the gear1 or which ever gear while pressing clutch it goes into neutral as it should but once neutral key is released and gear key has been pressed ever since the beginning it stays in neutral it doesnt go to gear 1 until i release gear1 key as press it again

any help?

i would like it to go to selected gear after neutral key is released, take note gear key was never released when clutch has been pressed.

screenshot will be posted

in screenshot i tried both get current and get target gear to maybe see if either can do anything but both gives same result

another thing ive noticed is, when 1 key is pressed and held in, and another key is pressed at the same time, the key being held is overridden by the last key pressed, is there a work around to this? i think this is the issue here, that the key held down is overridden by the last pressed key and not updated to notice key thats held down is still held down? i hope this makes sense

I’m having troubles with chaos vehicle myself, the behavior with the clutch/gear seems completely incorrect. :frowning:

I think your problem is that when you are in gear and press the clutch, you are setting the gear to 0, and upon release of clutch your setting it again back to 0 as that is now also the current gear since you set it as soon as the clutch was pressed. You are doing this twice in as well, so you can probably get rid of that extra node.

Instead, upon clutch release you should be setting it to the latest selected gear. That way releasing the clutch will go back to the correct gear.

edit: I quickly tried emulating what I think is your desired behavior. Could you try?

I will try this and let you know, also im using an H shifter for the gears, thats why i said the key doesn’t release, but i will try your method and let you know, thanks alot

This method of yours actually works nicely, but i see an issue.
Okay so im using an H shifter /game shifter right, now eg. I press clutch yes it engages, lets say i put it in 1st gear and press clutch, then it goes to neutral as expected, and released it goes to gear, but now when pressing clutch and selecting gear without yet releasing clutch it already goes into selected gear while clutch is still pressed, i think this issue is where the last pressed key overrides any key pressed and held down, but also does not notice key is still pressed after previous button is released, does this make sense the way i explained it? Do you perhaps know what the issue is?

Thank you for the help though.

Edit: another thing, im also using pedals, how can i use an axis mapping for the clutch rather than an action mapping, i always struggle with this because of the axis value, where do i even plug it in because ā€˜set target gear’ uses an integer, and yes the float value from the axis mapping can convert, but that will only cause the target gear to go to 1 because axis mapping is set to 1.0. Any idea how i can use axis mapping? And maybe have it engage only when pedal is at 0.5?

Are you sure you copied my bp? The target gear should not switch until the clutch is released, only the Gearbox Gear which is a bp variable. Could you show your current bp?

Using axis should be quite similar to what you have now, except that a events will keep firing as you change the value of your clutch input. I don’t have any pedals to test things out, but if just add an axis mapping instead of action mapping, your input event should have an extra node for the current value of your pedal.

You should probably switch to enhanced input, as the regular inputs are deprecated. This is how you can do it.

On your pawn:

The context is where you assign what pressed keys do, and the actions should be pretty self explanatory once you open them.

Context for mapping the throttle (both for a press with a keyboard and for axis with a controller)

The input itself is set up as an axis 1D. The keyboard press will instantly go from 0 to 1, and for a controller it will reflect how much you push the axis.

1 Like

here is my BP , see for now i havent used the pedals yet, as i see i have an issue with the clutch pedal that has a slight press so i’ll have to open up the pedals and fix it myself, but i have assigned a button to it, but anyways, the issue still persists as previously stated as where if i press clutch yes it engages into neutral but if a gear is selected and clutch is still pressed in the whole time, the last pressed button, in this case the gear button it overrides the button that held in which is the clutch, and it shouldnt engage into any gear until clutch button is released.

maybe if i use the enhanced input and select the hold option for the clutch and not just a press?

i’ll also get back to you on making the clutch an axis mapping, i bet i’d need your help on that too as i feel i’ll struggle abit with engaging only on 0.5 press.

It seems like you are not doing what I did. You should only be setting the target gear upon clutch release, everything else should just be setting the gear variable. Try to look at my blueprint again, its much more simple that what you currently have.

1 Like

here i’ve done exactly as yours, issue im having now if i put H shifter in neutral position it stays in the last selected gear and does not go to neutral, however if i add the set target gear node to the released , it also gives some weird actions, eg. putting H shifter into neutral does not go to neutral instead stays in last selected gear, will have to select gear without pressing clutch and then change to neutral again to get it to gear 0


this is the BP with 0 added to release, because yours does not take it back to neutral when H shifter is in neutral, any ideas?

edit; also if clutch is not pressed, even when putting H shifter into any gear it will not select, clutch has to be pressed, i dont think this is a problem, just putting it out there

Again, you are setting target gear instead of the variable on release. That means you will go back to previous gear that was set in the variable upon release even with your shifter in neutral since you never set the variable to neutral as well.

About the clutch, yes, you could remove that behavior, I put it in as I would assume that shifting without clutch would probably lead to some other behavior. Engine shutdown/gear grinding sound. But of course, feel free to modify that part as needed.

1 Like

im so confused, how do i set the variable on release? apologies if im a pain in the …

also another thing i managed to do successfully was the clutch enhanced input to only engage at 0.5, used the dead zone, works perfectly with the pedals.

oh and thanks for the enhanced input that you showed me earlier.

Instead of Set Target Gear node on release, use the set node for the variable ā€œGearā€ like you do on all your input actions.

1 Like

:grin:You’re a fliping genius! Thanks, it works now…

I’m still trying to understand the BP logic abit better, do you perhaps have some tutorials somewhere online where you teach about blueprints etc? Would love to go and watch, or anyone you’d suggest i go watch / learn from?

Awesome! :smiley: No, I don’t have any particular recommendations, I did do 2 courses on Udemy which of course help in the beginning, but I’d say just trial and error will teach you the most. Once things click, they click forever! So just try to understand why this works and you will be good to go tackling your next problem.

1 Like

sorry for jumping in @emil.je - but guys do we have a change to apply 50% clutch on axis or not? As far as I understand this post its just about clutch on/off - but not " a little bit of clutch " which you want on a rally game eg. Also going throught the chaos sources makes me go aaaaaaa - the clutchmodule.cpp looks promising - but I don’t know how to hook into that functionality as the clutch values are hardcoded… which I bang my head against the wall on so many times - idk why epic is doing this over and over again…or my C++ foo ist not strong enough maybe :slight_smile:

It seems that they might include the clutch module in 5.4. You can track the ticket here, and put your vote in so it has more chances of coming through!

sorry for late reply
actually if you use
triggers - down
modifiers - deadzone 0.5 and 1.0
this will help with clutch engagement at 50% in enhanced input actions

i also dont understand when you say little bit of clutch? it either engages or not, and reality its at about 50% of the way back up then it engages, is that not so? else your gears would be slipping in reality. right?

hi i am woking on same can u give some logic idea how to done this clutch

check @emil.je blueprint screenshot he sent in this topic, i used that for the logic for the gear shifting on my H shifter, you can change it abit if you’re using a joystic, that would then be what you choose.

then with enhanced inputs you can check out dead zone for clutch, as i mentioned above also .

note also, when using steering wheel with pedals and H shifter , you’ll need to use raw input and then direct input



it’s going back to the neutral