generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Another Weld Question

Previous Thread :: Next Thread 
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
24 Apr 2017 11:20 PM
I am currently moving this vehicle with BodyMovers
Please watch the demonstration (qyazo gif):
/715f5c05be8fb07e74e396e6b73a0d47

The turret cannot be held by ManualWelds because it is capable of it own rotation. Constraints such as AlignPosition do not work to hold it above the chassis, as when the chassis collides with an object, the turret will just fly around (yes, rigidity enabled, max responsiveness, altering densities, I've tried everything)

In the video above, the Turret's PrimaryPart is being held in relation to the PrimaryPart of the Chassis by CFraming it on Heartbeat.

My only hope is that I can somehow use Motors to hold these things together, while allowing the Chassis to move, and allowing the Turret to rotate freely 4 studs above the Chassis PrimaryPart.

What do I need to know to stop the turret from rubberbanding like that?


Report Abuse
Casualist is not online. Casualist
Joined: 26 Jun 2014
Total Posts: 4443
24 Apr 2017 11:22 PM
Why u no use Motor//RotateV?
Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
24 Apr 2017 11:23 PM
I read it has something to do with surface input? Isn't that, like, 2006-2010 style?
I am at a loss for how to implement a Motor


Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
24 Apr 2017 11:39 PM
The Y u no meme is also from 2006-2010

Are you from 2006-2010
:) ?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
24 Apr 2017 11:41 PM
Yeah why aren't you using a Motor6D or whatever? it seems perfectly fine for your purposes since it only looks like you care about rotating about y
Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
24 Apr 2017 11:43 PM
The Turret will rotate on both the X and Y axes, while the Chassis will rotate on X and Z. Both are controlled from a single script and update about every 1/10 seconds.

Can a Motor6D help me with that?
Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
24 Apr 2017 11:44 PM
*Chassis will only rotate on the Y
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
24 Apr 2017 11:54 PM
Eh it'll get pretty ugly to have to deal with rotating about 2 different axes with Motors6Ds. There might be some new constraint that makes this easier but I'd just use Welds and constantly update C0 myself.
Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
25 Apr 2017 12:08 AM
Then I'm on the right track, but I'm having serious difficulty with my weld setup.

Every time I weld the turret to the chassis after changing the turret's position via loop, the chassis gets thrown out of whack, refuses to turn, and jitters forward in a straight line. I can resist this odd forward motion by moving backwards, but I can't turn.

I am welding like this:

local turretWeld = Instance.new("ManualWeld",turret.PrimaryPart)
turretWeld.Part0 = turret.PrimaryPart
turretWeld.Part1 = vehicle.PrimaryPart
turretWeld.C0 = CFrame.new(0,-4,0)

This properly holds my turret 4 studs above the PrimaryPart, but the chassis is somehow adversely affected by the weld.

I move my chassis with Throttle and Steer of a VehicleSeat, like this:
--while true do
local throttle,steer = seat.Throttle,seat.Steer
local ra### #a############################################################local part,pos,norm,mat = workspace:FindPartOnRayWithIgnoreList(ray,vehicle:GetChildren())
local yOff = pos.Y+8+math.sin(tick())
local hoverPos = vehicle.PrimaryPart.CFrame*Vector3.new(0,0,-throttle*10)
local hoverPos = Vector3.new(hoverPos.X,yOff,hoverPos.Z)

vehicleHover.Position = hoverPos
vehicleRotate.AngularVelocity = Vector3.new(0,-steer,0)
-- welds
-- end
Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
25 Apr 2017 12:09 AM
Censored bit is just raycasting
Report Abuse
Dalition is not online. Dalition
Joined: 13 Jun 2007
Total Posts: 166
25 Apr 2017 12:11 AM
Simple: Don't do it! :P
Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
25 Apr 2017 12:12 AM
^ How to stagnate and die dumb 101
Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
25 Apr 2017 12:34 AM
I would very much like to solve this three-day problem :'(
Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
25 Apr 2017 12:36 AM
If Motor6Ds and motors can't take into account more than one axis then I can't use them, which means that the only way to beat this is with the properties of welds.

Should I be setting the rotation of the Turret and then welding each frame, or setting the rotation of the Turret through the C0 of a singular weld along with the positional offset?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
25 Apr 2017 12:37 AM
Through C0
Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
25 Apr 2017 12:38 AM
When I said "welding each frame" I meant, in my loop, create the welds after all the positional/rotational changes are made.

I am also confused by why it would affect my chassis, especially if none of the parts are CanCollide
Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
25 Apr 2017 12:41 AM
Alright, if through a C0, how could I set its rotation to face a certain Vector3?

offset = CFrame.new(0,4,0)
lookAt = Vector3.new(0,0,0) -- changes constantly

C0 = CFrame.new(offset.p,lookAt)

^ like this? Where Part1 is the turret and Part0 is the chassis?
Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
25 Apr 2017 12:42 AM
* offset = vehicle.PrimaryPart.CFrame*CFrame.new(0,4,0)
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
25 Apr 2017 12:57 AM
Well not necessarily that because if Part0 is rotated it would be wrong.
You'd wanna do something like:
.C0 = Part0.CFrame:toObjectSpace(CFrame.new(Part0.Position, pointToLookAt))-Part0.Position or something (there's definitely a better way to do it but I'm on my phone.
Report Abuse
vat21s is not online. vat21s
Joined: 07 Jun 2010
Total Posts: 2508
25 Apr 2017 01:10 AM
Hey Soy,
I've been working on the same problem for a while now.
My turret uses a dual axis system where the Y rotation and the Tilt are controlled by separate welds.

astebin /nvUFeL64
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
25 Apr 2017 01:11 AM
Wouldn't separate welds with the same Part0/Part1 interfere with each other
Report Abuse
vat21s is not online. vat21s
Joined: 07 Jun 2010
Total Posts: 2508
25 Apr 2017 01:16 AM
The Tilt is welded to the Spin which allows me to just rotate it upwards.
I wanted to make my barrel and it's mount independent.

There's issues with the spinning, once the vehicle performs a 180 turn the turret the wrong way but the Tilt remains correct. If you can solve that issue then the rest should fall into place.
Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
25 Apr 2017 01:34 AM
@Cntkill I used your code, but my turret seems to be suspended thousands of studs away from where it should be above the chassis, any idea?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
25 Apr 2017 02:12 AM
You added that end part "-Part0.Position"?
Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
25 Apr 2017 12:51 PM
Yes, and you can see here that the turret is being warped to a completely different location on the map :(

/3f22d3f7eb09f4c0bbab8d19fc55c254


Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image