This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
Hey guys,
Brief preface: I'm a 1st year games design student and therefore have no idea what the fuck I'm doing - we're working on group projects right now and my limited programming knowledge got me promoted to developer as everyone else has even less concept of what the fuck they're doing...
So here's my problem. I have a quad with a scrolling texture (infinite runner style), using SetTextureOffset to achieve the effect. When my character collides with an NPC the scroll effect stops. However, as I'm doing the scroll effect like this:
offset = Time.time * scrollSpeed;
renderer.material.SetTextureOffset("_MainTex", Vector2(offset,0));
I have a problem. The scroll effect is stopped, but deltatime doesn't stop (naturally), so offset
continues to increment, meaning when I restart the scroll effect there's a visual jump as SetTextureOffset catches up with offset
's deltatime driven value.
Honestly, I don't know what kind of solution I'm looking for here (braindead from trying a load of different ideas). Any advice? My last-resort option is to just have a carousel of sprites spawning in instead of using a single quad with texture offset.. but I don't wanna do that if it's avoidable 'cause it seems nasty and complicated and I won't have learned anything.
Thanks!
Subreddit
Post Details
- Posted
- 10 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/Unity3D/com...