Rotate in 45 degrees
I want to make my rotator rotate in 45 degrees (currently full analogue)...
I used rocket rotator. I output the local left stick on controller sensor to a splitter, then wired into x/y axis - set these to a thousand. Set strength of rotator and dampening to 100.
It works great and rotates but it's full analogue... Want to limit the rotatation so my tank faces only in 8 directions, North, NE, E, SE, S, SW, W, NW.
-
Place 8 tags in a cube which is invisible and non collidable
Place a teleporter in the cube that teleports to the tanks location
Move the tags positions to be the 8 positions you want it to face.
I hope this helps :) -
Use a look at rotator to face the 8 positions depending on the left stick position.
-
Do you want the tank to turn instantaneously to the next one of the 8 directions, or would you prefer it to animate, albeit quickly, and then lock on to the next direction?
I like your idea here because it could make the player’s job of navigation easier, especially for players with motor skills impairment, or simply not such good hand/eye coordination like some of us old blokes. -
https://indreams.me/element/b9Ndpfp9ERg
Made this Orientation Manager for you. Wire your +/- into it (or if you have another way of choosing which should be the direction to face, wire that straight into the selector).
It'll broadcast the chosen orientation, so wire a receiver for MyOrientation into a Look-At-Rotator's Scene Direction input on the last Tab. Give it high Strength and Damping and you're set. -
Thanks all. Out at the moment but will give this a try later. Appreciate it.
-
Really appreciate the logic StankyDino. Tried it but not sure what to put in +/-... Should that be an out put from my rocket rotator? Looking at it, it seems to be a selector, so will it allow me to switch immediately from N to SE etc by left stick movement or would it rotate in order? So... If I want W, would I need to go through N, NE, E, SE, S, SW, W, or can it go straight from N to W or W to SE (by pushing down right on analogue)?
-
Aecert - I take it the teleport will follow me wherever my tank goes? So... it'll float above me?
-
shooter that relies on 45 degree angles to work properly.
Aecert - created the teleporting cube with tags, follows me perfectly, very nice. I removed rocket rotator and replaced it with look at rotator. Named all tags as N, set rotator to look at N. Unfortunately it just spins... Wired local left into rotation speed. Also tried changing tags to be different to see if it just looks at one tag and it still just spins...? -
Right now it'll only cycle from one to an adjacent one, but I could modify it to select specific ones.
If you want to try to solve it before I get to it, here's a hint: use a splitter on whatever stick you want to control it, then compare the ratio of y to x. If the absolute value of x minus the absolute value of y is greater than a certain amount, it means that its more east/west. And then you can use whether or not y and x are each positive or negative to decide between the two
Sort of like a hacked together atan2 function but without the actual trig function. -
https://indreams.me/element/b_JCe73Wj6c
Here's the final thing.
Aecert's isn't working because all of the boxes are tagged as the same thing and it's trying to look at all of them at once. -
StankyDino - you are a genius! Works brilliantly! Thank you very much for that, you're a star! Does exactly what I needed. Didn't realise I had to ungroup the shape at first. Lol. Connected to microchip on vehicle and worked straight away. Thanks again!
-
Looking to do something similar, but 90 degree angles. What was the outcome? I read all the comments, but don't understand what's going on. And links didn't work. Is there a remixable dream i could look at? And help would be grateful
-
JR2576. Search my creations. I have remixed Stanky's rotator. If you want to try a working example, play Tank Attack level. Hope that helps.
Please sign in to leave a comment.