Way to move non humanoid

What would be the best way to move a non humanoid to the player? bodyvelocity?

BodyVelocity is one way, but you can also try Lerping the CFrame. Maybe weld/constraint it to one middle piece and lerp that.

oh yeah i def have a middle piece object in mind, it’s just that if i want to move this object i need it to have it fall. so idk if lerping the cframe will work

Actually, I’ve done something similar to what you are mentioning. Here is what I had :

function ControlModule:UpdateMovement(inputState)
	if inputState == Enum.UserInputState.Cancel then -- Stopped Moving
		self.MoveVector = Vector3.new(0,0,0)
	else
		self.MoveVector = Vector3.new(self.RightValue - self.LeftValue, 0, 0)
	end	
end	

function ControlModule:OnRenderStepped(delta)
	if self.Humanoid and self.Center then
		self.Center.BodyVelocity.Velocity = self.MoveVector	
		while self.DownValue do
			self.WSPChar.L.BodyForce.Force = Vector3.new(0,-300,0) 
			self.WSPChar.HumanoidRootPart.BodyGyro.MaxTorque = Vector3.new(0,3000,0)
			self.WSPChar.LL1.BodyGyro.MaxTorque = Vector3.new(0,3000,0)
			self.WSPChar.LR1.BodyGyro.MaxTorque = Vector3.new(0,3000,0)
			wait(0.1)
			self.WSPChar.L.BodyForce.Force = Vector3.new(0,0,0)
			self.WSPChar.HumanoidRootPart.BodyGyro.MaxTorque = Vector3.new(3200,3000,3200)
			self.WSPChar.LL1.BodyGyro.MaxTorque = Vector3.new(10000, 3000, 10000)
			self.WSPChar.LR1.BodyGyro.MaxTorque = Vector3.new(10000, 3000, 10000)
		end
	end
end

ah,
so what do you recommend i use? bodyforce then?

Yeah, BodyForce would work great. It’ll just take a bit of tinkering to figure out how much force to apply.

ah alright, would it require doing anything like cframe? or should i just set the bodyforce’s position to the characters

The direction your Character would move would be based on the Force. Which is a Vector3.

Ex.

Force = Vector3.new(0,300,0)  # Would make the Character go UP
Force = Vector3.new(300,0,0) # Would make the Character increase based on the X axis

The BodyForce itself would be in the Character. And when the Force is (0,0,0) the Character would be stationary.

oh no forgot to elaborate, the non-humanoid i’m talking about isn’t the player, but an enemy, should i set it to the player’s position?

I’m a bit confused myself now. The Force is relative to it’s Ancestor. It doesn’t need a set position. It simply applies a force in whatever direction it is set to. So I’d assume you’d just set it to the enemies position?

ah, then i think, if it’s going to a direction it’s set to, i could prob use the player’s pos

Uh, yeah, sure…? Are you setting the Enemy to the Players Position or the Force…?

the force, sorry if my wording is bad, it’s late where i am

bodymovers,Cframing,Tweening [spoiler]

[/spoiler]

I don’t think you would need to set a Location. It should already be relative to it’s Ancestor/Parent.

alright, i think i got a good idea on what i should do, despite my bad wording. thank you

1 Like