I am trying to make a turret, and i dont feel like using wheels.
I am thinking of something like this: make an object locked to a specific position while still alowing it to rotate. Id place a vector thrustor on the turret whose xyz inputs are wired to a beacon sensors world_xyz, the sensor wired to a target finder. That way the thruster will try to fly away, rotating the other side of the turret towards the target. I put the gun on the exact oposite side of the vector thrustor. This all depends on if i can lock an object to a specific position while alowing it to rotate. How could i do this?
you could weld a small prop to the ground and get the prop you want to be rotate-able you’d put on the spot in the air you’d want. freeze it, and ballsocket it to the prop welded to the ground. unfreeze it and voila! I’m not completely sure if this’ll work though
I did found a way, sort of. I ballsocketed two boxes together and noclipped both. I also disabled gravity. The vector thruster, however, refused to obey. I had the beacon sensor set to output world xyz, connect to target finder, the vector thrusters xyz to beacon sensors xyz output. I dunno what the thruster tried to fly to, but it was not the enemy.
A question: the vector thrustor will try to fly towards the coordinates that it is inputed, right? So if the beacon sensor outputs world_xyz then the vector thrustor will fly to that, right? Or is it coords in relation to its current position, so that if the vector thrustor is inputed 0,0,0 it will fly to where it already is.
Doesnt that restrict rotation? Or do you mean like, attach each rope to the same spot on the prop, but to different spots on the ground?
I just found something. The vector thrustor can apply force against its local as well as global coordinates, with local being default. If you use world xyz for the thruster you wont even need the gps. I just built a working jet with it. You have to be mindfull of its orientation when using local coords, as its rotation affects its behaviour. Use rotation snap and weld to get it straight.
Here’s an E2 that will keep a prop in one location, while allowing it to spin freely:
# We need the chip to remember these values.
@persist Mass:number Base:entity Target:vector
# This block is only executed the first time the chip runs
if(first() | duped())
# We'll set the base prop of the turret as whatever the
# expression chip is placed on:
Base = entity():isWeldedTo()
# We need to find the mass of everything attached
# to the base prop, because we'll be using the total
# contraption mass in our applyForce function
# First, we set variable Mass to the mass of the E2,
# because getConstraints doesn't include the chip itself
Mass = entity():mass()
# We set Props as an array of everything that is attached
# to our base prop, and run a For loop to add up every prop's
Props = entity():getConstraints()
for(Index = 1, Props:count())
Mass += Props[Index,entity]:mass()
# We need to set a Target vector for our base to hover at.
# As written, the target is 100 units above where the base
# starts at. Change this to wherever you need it to be.
Target = Base:pos() + vec(0,0,100)
# That's the end of the first() block. We will use runOnTick to
# cause the chip to continually execute everything from here on.
# We've already set the Target, but we also need the base's
# current position.
CurPos = Base:pos()
# We've got our target, our current position, and the mass of what
# we're moving, so we're ready to applyForce.
# Target - CurPos gives us the difference between where we are and
# where we want to go. -Base:vel() makes the ride much smoother,
# and we scale the amount of force by the mass that we want to