Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(2 edits)

shouldn't a relative_x += cos(time *frequency)*magnitude work better for spiraling instead of orbiting?

I have this for my unity 3d game (posting because orbiting is exactly what I did before this dawned on me);

    public static void clockrotator(GameObject obj, float _rotratex, float _rotratey, float _rotrad){
        obj.transform.Translate((new Vector3(
        obj.transform.position.x - Mathf.Cos(Time.fixedTime * _rotratex) * _rotrad, 
        obj.transform.position.y - Mathf.Sin(Time.fixedTime * _rotratey) * _rotrad,
        obj.transform.position.z) - obj.transform.position)
         * Time.deltaTime);
}

Maybe, maybe. But it still won't solve the underlying issue.

(1 edit)

I don't know about how to solve that besides bullet having a property that names its "parent", but I know it will end up being "why didn't I see this solution that was infront of me all this time" kind of thing :)