Posts

Post not yet marked as solved
0 Replies
489 Views
Hello! I am relatively new so please forgive me if its an easy fix. I have created a game whereby when the user respawns an an ad will show every fourth respawn, on unity and unity remote it works without issue, but when its built to Xcode the ads don't work, neither do they work on test flight. Within the Xcode debugger I get the below output. Sorry if it's not all required I'm just not sure what is relevant. Every time I die/ respawn I get a fresh reiteration of the last few paragraphs which don't seem to relate to ads. Any help would be hugely appreciated! Also, there are no issues within unity, however upon export to Xcode around eighty warnings appear. Thank you! Josh 2023-10-21 01:53:03.561960+0100 ImpossiBall[17144:3108483] UnityIAP UnityEarlyTransactionObserver: Created 2023-10-21 01:53:03.563628+0100 ImpossiBall[17144:3108483] UnityIAP UnityEarlyTransactionObserver: Registered for lifecycle events 2023-10-21 01:53:03.915378+0100 ImpossiBall[17144:3108483] Built from '2023.1/staging' branch, Version '2023.1.16f1 (e5ad54273a6f)', Build type 'Release', Scripting Backend 'il2cpp' 2023-10-21 01:53:03.916254+0100 ImpossiBall[17144:3108483] MemoryManager: Using 'Default' Allocator. [UnityMemory] Configuration Parameters - Can be set up in boot.config "memorysetup-allocator-temp-initial-block-size-main=262144" "memorysetup-allocator-temp-initial-block-size-worker=262144" "memorysetup-bucket-allocator-granularity=16" "memorysetup-bucket-allocator-bucket-count=8" "memorysetup-bucket-allocator-block-size=4194304" "memorysetup-bucket-allocator-block-count=1" "memorysetup-main-allocator-block-size=16777216" "memorysetup-thread-allocator-block-size=16777216" "memorysetup-gfx-main-allocator-block-size=16777216" "memorysetup-gfx-thread-allocator-block-size=16777216" "memorysetup-cache-allocator-block-size=4194304" "memorysetup-typetree-allocator-block-size=2097152" "memorysetup-profiler-bucket-allocator-granularity=16" "memorysetup-profiler-bucket-allocator-bucket-count=8" "memorysetup-profiler-bucket-allocator-block-size=4194304" "memorysetup-profiler-bucket-allocator-block-count=1" "memorysetup-profiler-allocator-block-size=16777216" "memorysetup-profiler-editor-allocator-block-size=1048576" "memorysetup-temp-allocator-size-main=4194304" "memorysetup-job-temp-allocator-block-size=2097152" "memorysetup-job-temp-allocator-block-size-background=1048576" "memorysetup-job-temp-allocator-reduction-small-platforms=262144" "memorysetup-temp-allocator-size-background-worker=32768" "memorysetup-temp-allocator-size-job-worker=262144" "memorysetup-temp-allocator-size-preload-manager=262144" "memorysetup-temp-allocator-size-nav-mesh-worker=65536" "memorysetup-temp-allocator-size-audio-worker=65536" "memorysetup-temp-allocator-size-cloud-worker=32768" "memorysetup-temp-allocator-size-gfx=262144" -> applicationDidFinishLaunching() [Physics::Module] Initialized MultithreadedJobDispatcher with 5 workers. 2023-10-21 01:53:05.583501+0100 ImpossiBall[17144:3108483] UnityIAP UnityEarlyTransactionObserver: Added to the payment queue [Subsystems] Discovering subsystems at path /private/var/containers/Bundle/Application/1BA6BB08-6048-4D68-A1A4-3B145008D144/ImpossiBall.app/Data/UnitySubsystems GfxDevice: creating device client; threaded=1; jobified=0 Initializing Metal device caps: Apple A12 GPU Initialize engine version: 2023.1.16f1 (e5ad54273a6f) New input system (experimental) initialized -> applicationDidBecomeActive() UnloadTime: 7.309542 ms 2023-10-21 01:53:10.537017+0100 ImpossiBall[17144:3108483] UnityIAP: Requesting 1 products 2023-10-21 01:53:10.578393+0100 ImpossiBall[17144:3108800] I/UnityAds: -[USRVInitializeStateConfig execute] (line:36) :: =============== USRVInitializeStateConfig ============= 2023-10-21 01:53:10.578491+0100 ImpossiBall[17144:3108800] I/UnityAds: -[USRVInitializeStateConfig executeLegacy] (line:41) :: =============== USRVInitializeStateConfig LEGACY FLOW ============= 2023-10-21 01:53:10.578522+0100 ImpossiBall[17144:3108800] I/UnityAds: -[USRVInitializeStateConfig executeLegacy] (line:42) :: Loading Configuration https://configv2.unityads.unity3d.com/webview/4.4.2/release/config.json?gameId=5436683 2023-10-21 01:53:10.594026+0100 ImpossiBall[17144:3108483] UnityIAP: Requesting product data... 2023-10-21 01:53:12.165513+0100 ImpossiBall[17144:3108800] I/UnityAds: -[USRVInitializeStateConfig executeLegacy] (line:52) :: Saving Configuration To Disk 2023-10-21 01:53:12.219001+0100 ImpossiBall[17144:3108799] I/UnityAds: -[USRVInitializeStateLoadCache execute] (line:23) :: Unity Ads init: webapp loaded from local cache WARNING -> applicationDidReceiveMemoryWarning() 2023-10-21 01:53:13.492252+0100 ImpossiBall[17144:3108799] UnityIAP: Received 1 products 2023-10-21 01:53:13.692454+0100 ImpossiBall[17144:3108483] UnityIAP: Transaction 2000000434244328 not pending, nothing to finish here 2023-10-21 01:53:13.692517+0100 ImpossiBall[17144:3108483] UnityIAP: Add transaction observer 2023-10-21 01:53:13.694065+0100 ImpossiBall[17144:3108483] UnityIAP UnityEarlyTransactionObserver: Request to initiate queued payments Unloading 5 Unused Serialized files (Serialized files now loaded: 0) UnloadTime: 2.816416 ms Unloading 18 unused Assets to reduce memory usage. Loaded Objects now: 1164. Total: 6.366292 ms (FindLiveObjects: 0.039166 ms CreateObjectMapping: 0.024542 ms MarkObjects: 5.239167 ms DeleteObjects: 1.062750 ms) 2023-10-21 01:53:14.739476+0100 ImpossiBall[17144:3108483] I/UnityAds: +[USRVApiSdk WebViewExposed_logInfo:callback:] (line:72) :: Requesting configuration from https://publisher-config.unityads.u...Oq4JRVAmtsChcPYoL_7aBaUeYROvVhhyTB3kX3N6PAQ== 2023-10-21 01:53:14.862391+0100 ImpossiBall[17144:3108483] I/UnityAds: +[USRVApiSdk WebViewExposed_logInfo:callback:] (line:72) :: Received configuration for token eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhYmciOjE2LCJhcHAiOjU3LCJhcHBMZXZlbENvcHBhIjpmYWxzZSwiYXR0IjowLCJhdWMiOjI0NywiYXVpIjoxMzMsImF6cCI6ImJjZGQwYzRjLTY0M2ItNGUxNy1hZjc1LTg2NjhjZWE2ZmY0MCIsImJzdCI6OTMsImNhbGN1b 2023-10-21 01:53:14.887380+0100 ImpossiBall[17144:3108483] LTE 2023-10-21 01:53:14.890406+0100 ImpossiBall[17144:3108483] LTE Initialization complete UnityEngine.Advertisements.Utilities.CoroutineExecutor:Update()
Posted Last updated
.
Post not yet marked as solved
0 Replies
388 Views
Hello, My game app is having FPS issues, both on simulator and device. There aren't any issues until my sknodes get added to the scene. I've read plenty of forums and as of yet nothing seems to work. Ive checked my performance and the memory isn't particularly high. Any help would be massively appreciated. Thank you! import SpriteKit import GameplayKit class GameScene: SKScene, SKPhysicsContactDelegate {     let player = SKSpriteNode(imageNamed: "Player")     var touchingPlayer = false     var gameTimer = Timer()     let scoreLabel = SKLabelNode(fontNamed: "AvenirNextCondensed-Bold")     var score = 0 {             didSet {                 scoreLabel.text = "SCORE: \(score)"             }         }          override func didMove(to view: SKView) {                  let background = SKSpriteNode(imageNamed: "Background.png")         background.zPosition = -1         background.size = CGSize(width: 1334, height: 750)         background.position.x = 0         addChild(background)                  scoreLabel.zPosition = 2         scoreLabel.position.y = 100         addChild(scoreLabel)         score = 0                  player.position.x = -200         player.zPosition = 1         player.name = "Player"         player.size = CGSize(width: 70, height: 70)         addChild(player)                           gameTimer = Timer.scheduledTimer(timeInterval: 0.35, target: self, selector: #selector(createEnemy), userInfo: nil, repeats: true)                  player.physicsBody = SKPhysicsBody(texture: player.texture!, size: player.size)         player.physicsBody?.categoryBitMask = 1         player.physicsBody?.affectedByGravity = false                  physicsWorld.contactDelegate = self              }               func touchDown(atPoint pos : CGPoint) {     }          func touchMoved(toPoint pos : CGPoint) {     }          func touchUp(atPoint pos : CGPoint) {     }     override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {                          guard let touch = touches.first else {return}                 let location = touch.location(in: self)                 let tappedNodes = nodes(at: location)                          if tappedNodes.contains(player) {                     touchingPlayer = true                 }     }          override func touchesMoved(_ touches: Set<UITouch>, with event: UIEvent?) {                     guard touchingPlayer else {return}            guard let touch = touches.first else {return}                let location = touch.location(in: self)            player.position = location     }          override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) {         touchingPlayer = false     }     override func update(_ currentTime: TimeInterval) {                          for node in children {                     if node.position.x < -700 {                         node.removeFromParent()                     }                 } //                if player.position.x < -300 { //                    player.position.x = -300 //                } else if player.position.x > 300 { //                    player.position.x = 300 //                } // //                if player.position.y < -200 { //                    player.position.y = -200 //                } else if player.position.y > 200 { //                    player.position.y = 200 //                }     }          @objc func createEnemy(){             let randomDistribution = GKRandomDistribution(lowestValue: -350, highestValue: 350)             let sprite = SKSpriteNode(imageNamed: "Virus")             sprite.position = CGPoint(x: 700, y: randomDistribution.nextInt())             sprite.name = "Virus"             sprite.zPosition = 1             sprite.size = CGSize(width: 70, height: 70)             addChild(sprite)             sprite.physicsBody = SKPhysicsBody(texture: sprite.texture!, size: sprite.size)             sprite.physicsBody?.velocity = CGVector(dx: -500, dy: 0)             sprite.physicsBody?.linearDamping = 0             sprite.physicsBody?.contactTestBitMask = 1             sprite.physicsBody?.categoryBitMask = 0             sprite.physicsBody?.affectedByGravity = false             createBonus()         }         func createBonus(){             let randomDistribution = GKRandomDistribution(lowestValue: -350, highestValue: 350)             let sprite = SKSpriteNode(imageNamed: "Vaccine")             sprite.position = CGPoint(x: 700, y: randomDistribution.nextInt())             sprite.name = "Vaccine"             sprite.size = CGSize(width: 70, height: 70)             sprite.zPosition = 1             addChild(sprite)             sprite.physicsBody = SKPhysicsBody(texture: sprite.texture!, size: sprite.size)             sprite.physicsBody?.velocity = CGVector(dx: -500, dy: 0)             sprite.physicsBody?.linearDamping = 0             sprite.physicsBody?.contactTestBitMask = 1             sprite.physicsBody?.categoryBitMask = 0             sprite.physicsBody?.collisionBitMask = 0             sprite.physicsBody?.affectedByGravity = false         }              func didBegin(_ contact: SKPhysicsContact) {                  guard let nodeA = contact.bodyA.node else {return}             guard let nodeB = contact.bodyB.node else {return}                  if nodeA == player {                 playerHit(nodeB)             }             else {                 playerHit(nodeA)             }         }              func playerHit(_ node: SKNode) {                  if node.name == "Virus" {             if let particles = SKEmitterNode(fileNamed: "dead.sks") {                 particles.position = player.position                 particles.zPosition = 3                 addChild(particles)                 }                                  player.removeFromParent()                              } else if node.name == "Vaccine" {                 if player.parent != nil {                 score += 1                 }                 node.removeFromParent()                 return             }                  DispatchQueue.main.asyncAfter(deadline: .now() + 3) {                 if let scene = GameScene(fileNamed: "GameScene") {                     scene.scaleMode = .aspectFill                     self.view?.presentScene(scene)                 }             }     } }
Posted Last updated
.
Post not yet marked as solved
0 Replies
352 Views
Hello, I am building an running app and am using a polyline to show where the user has ran, however when it gets to around 2.5/3 mile mark the polyline removes it self from the back, so when the run is finished the user can only see the last few miles and not the entire run, i have read through my code many many times and cannot figure it out, any help would be massively appreciated. My code is attached. code - https://developer.apple.com/forums/content/attachment/35f18ad7-5880-4c1b-8ac6-b0c4adac362a
Posted Last updated
.
Post not yet marked as solved
0 Replies
280 Views
I am trying to update a timer when the app is closed and then re opened, I know its a case of saving the time its closed, then calculating the difference between time closed and opened before adding it to the time count prior to it been closed, I have implemented the above code and for all the reviewing in the world I cant seem to figure out the issue. Any help would be massively appreciated. I have reviewed other similar problems but as of yet haven't found the solution, from my code I cant see where I sam going wrong . Thanks again! Josh Code - https://developer.apple.com/forums/content/attachment/0bfc501a-5d6b-4a14-998e-768ca142dabd
Posted Last updated
.
Post not yet marked as solved
2 Replies
400 Views
Hello all, I am creating a run tracker and want to enable background capability for the timer and location. The timer temporarily works in the background but then times out between 30 and 60 seconds and doesn't continue counting until it's reopened. I have tried saving the time its closed and reopened and calculating the difference between them but this doesn't seem to work. My code is attached and any help would be appreciated soo much as I've been stuck with this for a few weeks. I've put the whole view controller in so some of the code isn't relevant but thought it may be helpful to have it all. Thank you in advance! View controller - https://developer.apple.com/forums/content/attachment/04eb8e4c-72db-4725-91a5-2d87d417f164
Posted Last updated
.
Post not yet marked as solved
0 Replies
415 Views
Hello,I've taken some advice on this so far but noting seems to be working, any help would be massively appreciated!So I have a fitness app, the user selects one workout before it been displayed as table view, when a cell is selected I want it to show that cell(containing an exercise) as completed by marking it with a checkmark. this works fine but I am struggling with how to save that check mark when the app is terminated and re launched.Below I have given an example of one of the workout models and the table view controller, and struct.Please can someone try and solve this!!Thank you.JoshI have struct for the workouts as follows:import Foundationimport UIKitstruct Workout { var exercise : String = String() var completed : Bool = false init(exercise: String, completed: Bool = false) { self.exercise = exercise self.completed = completed }}Workout model example -import Foundationimport UIKitimport CoreDataclass The600Workout { var workoutArray = [ Workout(exercise: "Don't forget to warm up before every workout!"), Workout(exercise: "Start with little/ no weight and work your way up"), Workout(exercise: "------------------------------------------------------------------"), Workout(exercise: "Pull ups | 25 Reps"), Workout(exercise: "Lunges | 50 Reps (Low weight)"), Workout(exercise: "Calf Raises | 50 Reps (Low weight)"), Workout(exercise: "Shoulder press | 50 Reps (Low weight)"), Workout(exercise: "Push ups | 50 Reps"), Workout(exercise: "Shrugs | 50 Reps (Low weight)"), Workout(exercise: "Leg raises | 50 Reps"), Workout(exercise: "Bench press | 50 Reps (Low weight)"), Workout(exercise: "More Pull ups | 25 Reps"), Workout(exercise: "Squats | 50 Reps (Low weight)"), Workout(exercise: "Incline Bench press | 50 Reps (Low weight)"), Workout(exercise: "Bicep curls | 50 Reps (Low weight)"), Workout(exercise: "Tricep pull downs | 50 Reps (Low weight)"), ]} import UIKitclass workoutTableView: UIViewController, UITableViewDataSource, UITableViewDelegate {import UIKitimport GoogleMobileAdsclass workoutTableView: UIViewController, UITableViewDataSource, UITableViewDelegate { @IBOutlet weak var workoutTableView: UITableView! @IBOutlet weak var bannerAd2: GADBannerView! var navTitle: String = "" var workout = [Workout]() let tlabel = UILabel() override func viewDidLoad() { super.viewDidLoad() setWorkout() workoutTableView.delegate = self workoutTableView.dataSource = self tlabel.text = navTitle tlabel.textAlignment = .center tlabel.font = UIFont(name: "Arial Rounded MT Bold", size: 30) tlabel.adjustsFontSizeToFitWidth = true navigationItem.titleView = tlabel bannerAd2.adUnitID = "ca-app-pub-3940256099942544/2934735716" bannerAd2.rootViewController = self bannerAd2.load(GADRequest()) } func setWorkout() { if navTitle == "The 600 Workout" { workout = The600Workout().workoutArray } else if navTitle == "5 Days for Muscle" { workout = FiveDaysForMuscle().workoutArray } else if navTitle == "Marathon Ready" { workout = MarathonReady().workoutArray } else if navTitle == "HIIT @ Home" { workout = HIITAtHome().workoutArray } else if navTitle == "Get Strong" { workout = GetStrong().workoutArray } else if navTitle == "Body Weight Blast" { workout = BodyWeightBlast().workoutArray } else if navTitle == "Bands Pump" { workout = BandsPump().workoutArray } else if navTitle == "******* Warm up" { workout = QuickieWarmUp().workoutArray } else if navTitle == "The Best Circuit Workout" { workout = TheBestCircuit().workoutArray } else if navTitle == "The Gym HIIT Workout" { workout = GymHIIT().workoutArray } else if navTitle == "The Ultimate Workout" { workout = UltimateWorkout().workoutArray } else if navTitle == "Warm up For Weights" { workout = WarmUpForWeights().workoutArray } else if navTitle == "6 Day Bro Split" { workout = SixDayBroSplit().workoutArray } else if navTitle == "Explosive Workout" { workout = ExplosiveWorkout().workoutArray } else if navTitle == "Strength Circuit" { workout = StrengthCircuit().workoutArray } else if navTitle == "Killer Circuit" { workout = KillerCircuit().workoutArray } else if navTitle == "Fitness Test" { workout = FitnessTest().workoutArray } } func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int { return workout.count } func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { workout[indexPath.row].completed = !workout[indexPath.row].completed tableView.cellForRow(at: indexPath)?.accessoryType = workout[indexPath.row].completed ? .checkmark : .none tableView.deselectRow(at: indexPath, animated: false) } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "prototypeCell", for: indexPath) cell.textLabel?.text = workout[indexPath.row].exercise cell.accessoryType = workout[indexPath.row].completed ? .checkmark : .none cell.layer.borderWidth = 5 cell.layer.cornerRadius = 20 cell.layer.borderColor = colorLiteral(red: 0, green: 0.3285208941, blue: 0.5748849511, alpha: 1) cell.textLabel?.textColor = UIColor.black cell.textLabel?.adjustsFontSizeToFitWidth = true cell.textLabel?.font = .boldSystemFont(ofSize: 15) return cell }}
Posted Last updated
.
Post not yet marked as solved
5 Replies
1.7k Views
Good Evening,So I have a fitness app, the user selects one workout before it been displayed as a table view, when a cell is selected I want it to show that cell(containing an exercise) as completed by marking it with a checkmark. this works fine but I am struggling with how to save that check mark when the app is terminated and re launched.So all my workouts conform to a struct containing an exercise(String) and completed(Bool) property. When the user clicks the cell and presents the check mark/ removes the checkmark i want the completed property to switch the bool in the model and save it as such.There are currently around fifteen models/ fifteen workouts and I cant find a way of achieveing it. I am fairly new to this so if any help could be offered I would be extremeley grateful!Please can someone try and solve this!!Thank you.Josh
Posted Last updated
.