October 31, 2020, 05:03:42 PM

Author Topic: Moving a 3d object at a speed slower than .6  (Read 567 times)

Offline phodiS

  • Jr. Member
  • **
  • Posts: 52
Moving a 3d object at a speed slower than .6
« on: June 20, 2020, 02:04:24 AM »
I have a 3d terrain, with an object that can move around on it following the height; works great... but it's going way to fast.... If I change the speed of the object
to anything less than .6  it simply wont move. Is there a way to do this?.... I'm hoping for a speed of say .2, which I ~think would look more to scale.

Offline blinkok

  • Sr. Member
  • ****
  • Posts: 253
Re: Moving a 3d object at a speed slower than .6
« Reply #1 on: June 20, 2020, 02:47:04 AM »
Is this using physics?

Offline phodiS

  • Jr. Member
  • **
  • Posts: 52
Re: Moving a 3d object at a speed slower than .6
« Reply #2 on: June 20, 2020, 04:55:29 AM »
Hi, no I am not using physics.

Offline blinkok

  • Sr. Member
  • ****
  • Posts: 253
Re: Moving a 3d object at a speed slower than .6
« Reply #3 on: June 20, 2020, 05:54:22 AM »
If you're not using physics then i'm pretty sure your using integers somewhere and it's rounding to 0

Offline peteswansen

  • Jr. Member
  • **
  • Posts: 57
Re: Moving a 3d object at a speed slower than .6
« Reply #4 on: June 20, 2020, 09:47:10 AM »
are you using collision mode with the terrain or just placing it above the terrain Y height?... also what is the X and Z dimension of the terrain?
 

Offline Qube

  • Administrator
  • Hero Member
  • *****
  • Posts: 2537
  • I mostly code at night... Mostly.
    • SyntaxBomb - Indie Coders
Re: Moving a 3d object at a speed slower than .6
« Reply #5 on: June 20, 2020, 08:52:36 PM »
If you're not using physics then i'm pretty sure your using integers somewhere and it's rounding to 0
That'd be my guess. Floats and delta time are a good base to start with for movement.
Mac mini ( 2018 / 2020 ), 3 GHz 6-Core Intel Core i5, 16 GB 2667 MHz DDR4, 1TB NVMe, eGPU Radeon Pro 580 8 GB, LG Ultragear 27GL83A-B 27 Inch
Commodore VIC-20, 1.1Mhz MOS 6502 CPU, 5KB RAM, VIC ( 6560 ) GPU

Until the next time...

Online Steve Elliott

  • Hero Member
  • *****
  • Posts: 2822
  • elgol 2021
Re: Moving a 3d object at a speed slower than .6
« Reply #6 on: June 20, 2020, 09:00:38 PM »
Quote
If I change the speed of the object to anything less than .6  it simply wont move.

That only happens when movement becomes set to 0.0 for a frame.
Windows 10, 64-bit, 16Gb RAM, CPU Intel i5, 3.2 GHz, Nvidia GeForce GTX 1050 (2Gb)
MacOS Catalina, 64-bit, 8Gb RAM, CPU Intel i5, 2.3 Ghz, Intel Iris Plus Graphics 640 1536 MB
Linux Mint 19.3, 64-bit, 16Gb RAM, CPU Intel i5, 3.2 GHz, Nvidia GeForce GTX 1050 (2Gb)
Raspberry Pi 3 and 4

Offline phodiS

  • Jr. Member
  • **
  • Posts: 52
Re: Moving a 3d object at a speed slower than .6
« Reply #7 on: June 21, 2020, 06:13:33 PM »
I am not doing collisions, I just have my character hovering a very small amount (.2) above the height-map. I might just try using physics and see how that goes. And yes I think it must be rounding the speed up to 1 as if I set the speed to .5 he won't move at all. I might scale the map down as well as it is gigantic with 1000+ trees. Al fun and games! :)

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal