Home    LittleBigPlanet 2 - 3 - Vita - Karting    LittleBigPlanet 2    [LBP2] Help!
#1

Having Turret turn with Analog Stick

Archive: 3 posts


I spent i good amount of time trying to get this to work but could. I am guessing i was making the problem more complicated than it really needs to be.

I need it so putting the stick to the right or left turns the top of the tank only so much. So with a range of 90 degrees in either direction. i want is so if the stick is turned half to the left the turret would turn only 45 degrees and if pushed all the way it would do 90 degrees.

I know i can make it so it rotates and i can just let go when it is as far as i want but that is not what i am trying to do.

Problem is i want its to what the game calls local space. So the joystick rotator doesnt help since it always thinks of it as pointing up where i want to to be pointing forward.
2011-03-25 18:19:00

Author:
Drastion
Posts: 11


I was pretty sure the joystick rotator had it's arrow-point to work in local space, but perhaps I'm mistaken. If I'm right, then what I wrote below might work:

The joystick rotator rotates an object to an angle arctan(y/x), where y is the up/down speed, x is the left/right speed. x and y are analog values (0-100%) for each axis... see this thread:

https://lbpcentral.lbp-hub.com/index.php?t=53559-How-to-divide-analogue-signals&highlight=joystick+rotator

It sounds like you're trying to do the same calculation, only you're throwing out y values < 0. Take the up/down output of your analog stick and feed it into a direction splitter. Take the (+) output of the direction splitter and feed it into the (+) input of a direction combiner. Do not connect the (-) ends. Feed the output of the direction combiner into your joystick rotator, and connect the l/r output as normal.

Now, if I'm wrong about the joystick rotator, then your next best bet is probably to use a wobble bolt, since you are limiting the angle by which your object can rotate. You could remap the L/R outputs of the analog stick into the bolt, set to directional. It's not going to give you the same result as a joystick rotator, but left/right on the stick will rotate your turret counterclockwise/clockwise.

Hope this helps.
2011-03-25 18:56:00

Author:
Thegide
Posts: 1465


Thanks for the help but i tried all that.

For some reason the joystick rotator does not have a local space setting like the other rotators.

The wobble bolt with 0 resistance and turned off worked great at limiting the move ment.

What i am trying to do is remake Steel Battalion into here. Was planning on using move controls since there were going to come out this month. But now they say some time this year is will be done. Not a good sighn guess there are focusing on getting the lbp in schools things going instead.

The one way i got this to work was having a set of tag sensors hooked up to followers. Then i had a tag set out in front hooked to a holo on the lower section. Each sensor had a stronger and stronger follower attached to it. That way the farther off center the turret was the stronger force was needed to turn it more. This worked perfectly when i manually changed the strength of the main rotator.

But when i tried to use Strength scale it didnt work at all. I assumed that a strength scale ment it would raise the strenth along with the signal but it didn. Maybe i have a setting wrong as the rotator would only activate when i had the stick about half way to the right or left. Then when it would activate it would be all on and go all the way to the side.
2011-03-25 19:21:00

Author:
Drastion
Posts: 11


LBPCentral Archive Statistics
Posts: 1077139    Threads: 69970    Members: 9661    Archive-Date: 2019-01-19

Datenschutz
Aus dem Archiv wurden alle persönlichen Daten wie Name, Anschrift, Email etc. - aber auch sämtliche Inhalte wie z.B. persönliche Nachrichten - entfernt.
Die Nutzung dieser Webseite erfolgt ohne Speicherung personenbezogener Daten. Es werden keinerlei Cookies, Logs, 3rd-Party-Plugins etc. verwendet.