Figuring out the Logic system
So i've been messing around with logic just trying to make a semi functioning base model for a car/kart and i'm having trouble figuring out how exactly to piece the logic together. I sort of got forward movement working (although I don't know how to change it's direction from one way to the other) but i'm confused when trying to rotate it. I've tried using the controller sensor to pick up movement from the left analog and trying that to the rotator but all I get is the object rotating on its own even when I try putting other things like the movement sensor in.
Anybody got any insights on this they can offer? I'm not looking for a straight but some bit of info to put me in the right direction would be nice, not even specifically to this but how the logic in general works on a fundamental level so I can understand it better. I tried looking at some of the cars already out there but to be honest I couldn't really understand what the creators did since i'm not too comfortable with the whole thing yet.
-
The first thing is to make sure you're using the "Left stick local" output and not the regular left stick output (it's on the 3rd tab of the controller sensor).
If you haven't already, you also want to output that to a splitter which will give you two outputs: (-1/+1 for up/down) and (-1/+1 for left/right).
At this point, you could plug your up/down output into a mover's speed. This would make an up press on the left stick move you positively along an axis, and backwards would move you negatively along that axis.
Alternatively, you could split your up/down and left/right outputs one more time so that each direction gives you a unique off or on output.
The best thing to do is to add number outputs along each step of the process so you know what exactly is being output.
Good luck! I still dont understand advanced rotators, so I cant help there, but hopefully that helps a little. -
Kia ora! I'm not sure if this is helpful but my approach is to think of tasks in two general ways.
One way is to apply logic to the item you want to move, like the front or rear wheels so they behave like a real vehicle - they roll forward and backward and they can turn around the vertical (y) axis for steering. That's what @OregnaSpindle is talking about below using splitters to separate the + and - values from the controller sticks and make velocities along an axis forward-moving and backward-moving.
Another way, which is kind of digital trickery, is to apply some logic to the whole vehicle. For instance, real steering logic might be fine but you might want to subtly rotate the whole chassis (which wouldn't happen in real life) using a rotator to supplement the wheel logic. This would also require some splitter logic.
This is the kind of thing I would need to dabble with myself to see what works. Remember there is often more than one way to achieve the same outcome when using logic so if something isn't working try another train of thought. Be ready to make mistakes and learn from them :)
Please sign in to leave a comment.