#Flying Vehicle Details

227 messages · Page 1 of 1 (latest)

hushed flint
#

So I want to make a simple pirate game. You have a ship. I need a system sort of like a flying vehicle but I don't understand how to connect all the parts and why you need an animation gizmo and a cube, etc. Can somebody please fill in the details so I understand how they work?

hushed flint
#

Flying Vehicle Details

hidden dagger
#

bryh

#

u gotta clarify

hushed flint
#

and like what hold what in place

hushed flint
#

@hidden dagger

lean spoke
hushed flint
hidden dagger
gentle lantern
# hushed flint What's the right answer

seat is because you cant rotate players on the Y or X axis, only Z (left and right). But seats can. Im geussing the shape your talking about is the steering refference for the circuits (i use trigger handle), in which animation gizmo snaps the steering object in place whenever you let go of it. And a clamp (piston v2 is less ink tho) clamps the animation to the seat.

hushed flint
#

I only need to rotate on Z

#

so how do I set it up without a seat

gentle lantern
# hushed flint I only need to rotate on Z

So no seat, just clamp animation to the ship, and with the circuits, replace anything for the seat, with ship, but use vector split n such so it dosnt go up or strafe. And Quaternion split at y,w i think, so it dosent tilt anywhere causeing the player to go off

hushed flint
#

wait so do I move the ship as an object and if so arent I supposed to use a respawn

gentle lantern
hushed flint
#

its a bool value in the chip

gentle lantern
hushed flint
#

what do I add to it and then respawn

#

also its a singleplayer game and the ship will run at 60hz

gentle lantern
#

After the movement vector is done, add a small vector create to it, with Z being how much extra you want to move forward

hushed flint
gentle lantern
#

that, or add to the Z split to the Z create, that may work too

gentle lantern
hushed flint
#

well I want the steering object to be a wheel

#

but how do i keep the wheel in place

#

oooh wait i have an idea

#

I gotta try this real quick

gentle lantern
#

in that case, since the steering object will move forward depending on how far or close the steering object is to the ship, which is pivot based, so maybe you should add a dynamic offset accounting for the steering objects distance from the pivot, and then add

gentle lantern
hushed flint
gentle lantern
hushed flint
#

I have an issue

#

I don't know how to set rotation works with the axis on which an ink object is oriented

#

so like

#

i have a wheel

#

but its pivot point is all whack

gentle lantern
hushed flint
#

yeah

#

I just want the wheel to point towards where I let go of the handle

#

and stay there

#

i dont know how to do this it's too complicated

gentle lantern
# hushed flint yeah

Ok, this is the only comback method ik, it it dont work, ur gonna have to remake it with more care next time: look into the forward direction, create a cube, and manipulate it until its like a perfect hitbox for the wheel, center its pivot, then select the cube, then wheel abd merge. If wheel sets the cubes pivot to its pivot, edit it, and center pivot to cub and then delete it. If that dobt work, from what ik, theres no saving it

hushed flint
#

but how do I know if its not like backwards or upside down

gentle lantern
#

green is up, red right, blue forward

hushed flint
#

like if I set the rotation of an object to point towards something does the blue line point towards it?

hushed flint
#

alright

#

so I need the blue line to point from the center of the wheel to the top handle

gentle lantern
#

probably depending on what ur doing tho, subtracting away probably makes it point in oppisite direction

gentle lantern
hushed flint
#

align?

gentle lantern
hushed flint
#

so which line would point at the top handle

#

straight upward

gentle lantern
#

green

hushed flint
#

ok

#

@gentle lantern ok the green line is up now what

gentle lantern
hushed flint
#

how do I set the rotation of the wheel to where I want it to

#

sorry that came out really inspecific

#

I dont know how im gonna point the wheel

#

wouldnt I need to like get the y and x from a vector of some sort to get a plane rotation

#

because the blue line is facing forward to the front of the ship too

gentle lantern
#

Well wheel is gonna be seperate from the ship, so respawn it with position being the distance where it needs to be corresponding to the ships pivot, rotated by the ships rotation, and then added to the ships position. And i having done and handcrank stuff like that, thats y i suggested pancake's hancrank, but i could give like, expermental suggestions?

#

First off, respawning probably takes more cpu, so i would use a rotator with wired to the wheel and then the body to the chip for starters

#

that will keep its position instead of needing to respawn

hushed flint
#

how do I get the correct position that i need for the wheel?

gentle lantern
#

and then rotator set rotation would be in there

gentle lantern
#

so geussing u dont wanna use rotator?

hushed flint
#

o

#

I would prefer not but maybe itd be easier

gentle lantern
#

rotator would be easier, and i would take advantage of it for the sake of efficiency

hushed flint
#

okay so do I just clamp a rotator

#

to the ship

#

so it moves with it

gentle lantern
#

its below the paragraph, body to ship, rod to wheel

hushed flint
#

body?

gentle lantern
hushed flint
#

oh

#

okay so the rotator is held in place by the ship

#

and then the wheel is held by the rotator

gentle lantern
#

ye, wheel held by rotator's rod

hushed flint
#

ah i see

#

and then what

gentle lantern
#

then thats where idk at all xD i can give some experimental suggestions i never tried, and cant try bc im not on, that might work, that im sure someone will correct me for or sumn, but ye

#

also, your using trigger handle?

hushed flint
gentle lantern
hushed flint
#

no just the handle of the wheel that points up when the wheel isnt rotated

gentle lantern
#

yee

#

So id configure the rotator, remove all chips, edit it, and then 30hz, if ribbon is equipted via get first with tag. Then should rotator set rotation, and degrees from 0 to the degrees of distance the ribbon is at is what we need

hushed flint
#

how do I get the degrees

gentle lantern
#

idk, but can experiment xD

#

or just look it up, or wait until some else comes by

hushed flint
#

I know atan2 can get the degrees from two inputs

#

so maybe the z and y values of the vector3 position of the handle minus the position of the wheel?

gentle lantern
#

ok, so rotator get degrees, and then ribbon quaternion get axis which should output its rotation in degrees, but then im sure you could just turn your hand in place and then it would turn the wheel

gentle lantern
hushed flint
gentle lantern
#

it has to involve subtrancting tho, bc like vectors, if u subtract the right way, they'll follow eachother, so if we subtract the position of the wheel from the ribbon while taking in account for the up vector somehow, maybe that would work, but it needs to be in degrees n such/float

hushed flint
#

@gentle lantern well

#

im getting numbers

gentle lantern
#

ye xD

hushed flint
#

when I get the atan2 of the x and z value subtracted from the split of the handle minus the wheel

#

it says 90

#

wait no its wheel minus handle

gentle lantern
#

yee

hushed flint
#

wait no

#

hold up

#

handle minus wheel

#

yeah

#

okay but why does it say 90

#

it should be 0

gentle lantern
#

yee, probaly, idk the right subtraction order but i remember someone saying "destination - (idk forgot, but just the other thing)"

#

so should work bc handle is destination for the wheel

gentle lantern
hushed flint
#

o boy

#

let me seee

gentle lantern
#

xD

hushed flint
#

looks like it works actually hold on a sec

#

well

#

half of the time

gentle lantern
#

maybe it literally just needs a sub by 90 offset, my best geuess xD

hushed flint
#

if its more than 180 the atan2 goes negative

#

so i would need to add 90

gentle lantern
#

aight, the there u go xD

hushed flint
#

stay with me we're getting somewhere I think

gentle lantern
hushed flint
#

@gentle lantern looks like it works... I haven't yet tested it when the boat is rotated differently though

#

it works when its facing forward tho

gentle lantern
#

ah, but only when facing fowards?

hushed flint
#

but if it does work...

#

how would I convert that rotation to a turning speed?

gentle lantern
#

well gotta test it then xD

gentle lantern
hushed flint
#

it doesnt work

#

when the ship is backwards is spazzes

#

nevermind

#

it doesnt work unless facing forward

gentle lantern
hushed flint
#

which is the issue

#

no matter how the ship is faced, it still gets the rotation among the xy axis

#

so if the ship is sideways then you have to move the ribbon in front of and behind the wheel to make it work

#

and if its backwards its the opposite of if its forwards

gentle lantern
#

yeah but whats the maths in its current state

hushed flint
#

@hidden dagger How do I get a relative atan2 of a changing plane?

#

like the plane changes so if its facing forward you use x and y values in the atan2

#

but when its sideways you need y and z

hidden dagger
#

rotate by inverse of boat rotation

hushed flint
#

rotate what

hidden dagger
hushed flint
hidden dagger
#

idk

gentle lantern
#

thats y i wanted u to say what the maths are

#

lay it out, whats subtracting n all that

hushed flint
hushed flint
#

it decides using the position and subtracts them

#

but it always uses the y and x values of the positions

#

hence the issue

gentle lantern
#

so thats where u can rotate the vector

hushed flint
#

because it wont use the z values when it needs to in order for it to work

hidden dagger
gentle lantern
#

rotate, then use the split im geusing

hushed flint
# hidden dagger what is supposed to be relative to

Okay so I have a boat, it's wheel should rotate so that the top handle is always facing the position of an invisible ribbon thats attached to an animation gizmo so it hold it in place where the wheel is currently rotated

#

ill take a video and put it here

#

this is the issue

#

and i showed all the circuits

#

How fix

gentle lantern
#

Eh, then i got nothing but boolean system, but obviously it can be done with math, so id wait for cryptic, someone else, or research it more

#

but when its facing backwards, maybe try absolute value on the subtracts?

hushed flint
#

@hidden dagger ideas?

hidden dagger
hushed flint
#

okay put that into english and go step by step im stupid okay

#

what do I do first

hidden dagger
#

i think

#

idk it was a bad demonstration

hushed flint
#

I can re record it

#

what do you need to see

hidden dagger
#

wait solution

#

subtract handle position by wheel position

rotate the subtraction value by the inverse of the boat rotation

plug the X and Y values into Atan2

#

(or X and Z idk)

#

this way no matter how the boat is rotated it will always be correct

hushed flint
#

you cant subtract handle position (vector3) by wheel rotation (quat)

#

they both either have to be quat or vector

hidden dagger
#

also you cant subtract quaternions

#

since they are nothing like vectors

#

you can only multiply

hushed flint
#

okokok

#

got it

#

what chips do i use for step 2

#

to rotate the subtraction value by the inverse of the boat rotation

#

get rotation into a quat inverse chip right

#

but then how do i rotate the value by that

#

vector3 rotate?

#

is it the Rotate Vector chip?

#

@hidden dagger

hidden dagger
hushed flint
#

the wheel is spazzing the fuck out

#

what do i do

hidden dagger
#

just inv me

#

@hidden dagger

hushed flint
#

I sent a request to @hidden dagger

#

a friend request

hushed flint
#

@hidden dagger How do you recommend converting the rotation to turn speed? And what do I do if the player turns it more than 180 degrees?

hidden dagger
#

check out pancakes invention

#

edit n save

hushed flint
hushed flint
#

I mean to be fair I don't really know what I'm looking for

hushed flint
#

@royal dagger How do you make the thing from your hand crank where it calculates your total rotation depending on how many times you've rotated it

royal dagger
#

Use the delta rotation instead of the atan2 rotation directly
Try to figure the rest out urself(makes u smarter) or google it