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: Tweening parts without using Lerp?

Previous Thread :: Next Thread 
InfiniteYield is not online. InfiniteYield
Joined: 01 Mar 2012
Total Posts: 762
05 Aug 2016 02:50 AM
Im creating a bullet/lazer. How to do I tween/move the part to the target point? I got the position, I got the starting position. How do I make it GET there?
And without using Lerp, as the closer the target is, the slower the bullet is. And I dont know how to use BodyForce effectively.


Report Abuse
Kodran is not online. Kodran
Joined: 15 Aug 2013
Total Posts: 5330
05 Aug 2016 02:52 AM
You could use bodyposition. Just set the position to the goal position and set the maxforce and stuff.
Report Abuse
OzzyFin is not online. OzzyFin
Joined: 07 Jun 2011
Total Posts: 3600
05 Aug 2016 03:06 AM
"And without using Lerp, as the closer the target is, the slower the bullet is."
If this is the case you're using lerp wrong.
However you shouldn't really CFrame bullets until you use them just for the looks and do hit detection with a ray or something.
Report Abuse
InfiniteYield is not online. InfiniteYield
Joined: 01 Mar 2012
Total Posts: 762
05 Aug 2016 03:15 AM
I am using rays for hit detection. The bullets are just for show.


Report Abuse
OzzyFin is not online. OzzyFin
Joined: 07 Jun 2011
Total Posts: 3600
05 Aug 2016 03:25 AM
local startcf = whereeverTheBulletStartsFrom
local endcf = whereeverItEndsAt

for i = 1,4 do
i = i/4
bullet.CFrame = startcf:lerp(endcf,i)
wait()
end

idk how smooth that looks though
it reaches its destination in 0.12 seconds and if the distance was 100 studs it'd jump 25 studs every .03 seconds

I'd give the above a shot but otherwise use a BodyVelocity, it moves the bullet straight and smoother
Report Abuse
OzzyFin is not online. OzzyFin
Joined: 07 Jun 2011
Total Posts: 3600
05 Aug 2016 03:28 AM
Oh wait I totally misunderstood what you meant with the closer target
just use a BodyVelocity
Report Abuse
Kodran is not online. Kodran
Joined: 15 Aug 2013
Total Posts: 5330
05 Aug 2016 03:33 AM
"tween/move the part to the target point"
He should be using a bodyposition undoubtedly.
Report Abuse
OzzyFin is not online. OzzyFin
Joined: 07 Jun 2011
Total Posts: 3600
05 Aug 2016 03:48 AM
I doubt he wants the bullet to stop, BodyVelocity keeps constant speed

local dir = ((startCF*CFrame.new(0,0,-1)).p-endCF.p).unit*speed

BVelocity.Velocity = dir

I never get direction stuff right the first try but that's how I suppose it goes.
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